From 4fd25c1cb7fd0e0d1de4818ead3d1ac1e32e7eea Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Fri, 8 Sep 2023 14:17:58 -0700 Subject: [PATCH 01/15] Render EXTRACT columns in semantic model dataset by default --- metricflow/dag/id_generation.py | 1 + metricflow/dataset/convert_semantic_model.py | 48 +- metricflow/naming/linkable_spec_name.py | 47 +- metricflow/plan_conversion/column_resolver.py | 1 + metricflow/plan_conversion/dataflow_to_sql.py | 5 +- .../plan_conversion/instance_converters.py | 1 + metricflow/specs/specs.py | 4 + .../specs/where_filter_time_dimension.py | 2 + metricflow/sql/render/databricks.py | 8 + metricflow/sql/render/expr_renderer.py | 14 + metricflow/sql/sql_exprs.py | 64 + .../dataset/test_convert_semantic_model.py | 211 ++ .../test/model/test_data_warehouse_tasks.py | 4 +- ...st_convert_query_semantic_model__plan0.sql | 14 + ...le_semantic_model_with_measures__plan0.sql | 28 + ...semantic_model_without_measures__plan0.sql | 14 + ...st_convert_query_semantic_model__plan0.sql | 14 + ...le_semantic_model_with_measures__plan0.sql | 28 + ...semantic_model_without_measures__plan0.sql | 14 + ...st_convert_query_semantic_model__plan0.sql | 14 + ...le_semantic_model_with_measures__plan0.sql | 28 + ...semantic_model_without_measures__plan0.sql | 14 + ...st_convert_query_semantic_model__plan0.sql | 14 + ...le_semantic_model_with_measures__plan0.sql | 28 + ...semantic_model_without_measures__plan0.sql | 14 + ...st_convert_query_semantic_model__plan0.sql | 14 + ...le_semantic_model_with_measures__plan0.sql | 28 + ...semantic_model_without_measures__plan0.sql | 14 + ...st_convert_query_semantic_model__plan0.sql | 14 + ...le_semantic_model_with_measures__plan0.sql | 28 + ...semantic_model_without_measures__plan0.sql | 14 + .../test_common_semantic_model__dfp_0.xml | 4 + ...indow_or_grain_with_metric_time__dfp_0.xml | 1 + ...t_cumulative_metric_with_window__dfp_0.xml | 1 + ..._derived_metric_offset_to_grain__dfp_0.xml | 2 + ...st_derived_metric_offset_window__dfp_0.xml | 1 + ..._metric_offset_with_granularity__dfp_0.xml | 1 + ...erived_offset_cumulative_metric__dfp_0.xml | 1 + .../test_limit_rows_plan__dfp_0.xml | 1 + .../test_measure_constraint_plan__dfp_0.xml | 7 + ...traint_with_reused_measure_plan__dfp_0.xml | 3 + ...mantic_model_ratio_metrics_plan__dfp_0.xml | 4 + .../test_multihop_join_plan__dfp_0.xml | 128 + .../test_multiple_metrics_plan__dfp_0.xml | 2 + .../test_order_by_plan__dfp_0.xml | 2 + ...mantic_model_ratio_metrics_plan__dfp_0.xml | 4 + ...constrained_plan_time_dimension__dfp_0.xml | 2 + ...spine_node_with_offset_to_grain__plan0.xml | 1 + ...e_spine_node_with_offset_window__plan0.xml | 1 + ..._time_spine_node_without_offset__plan0.xml | 1 + .../test_common_semantic_model__plan0.sql | 168 + .../test_compute_metrics_node__plan0.sql | 70 + ...o_from_multiple_semantic_models__plan0.sql | 252 ++ ...atio_from_single_semantic_model__plan0.sql | 70 + ...ompute_metrics_node_simple_expr__plan0.sql | 70 + .../test_constrain_time_range_node__plan0.sql | 42 + .../test_cumulative_metric__plan0.sql | 28 + ...cumulative_metric_grain_to_date__plan0.sql | 28 + .../test_cumulative_metric_no_ds__plan0.sql | 28 + ...est_cumulative_metric_no_window__plan0.sql | 28 + ..._no_window_with_time_constraint__plan0.sql | 42 + ...ive_metric_with_time_constraint__plan0.sql | 42 + .../BigQuery/test_derived_metric__plan0.sql | 168 + ...ved_metric_with_offset_to_grain__plan0.sql | 210 ++ ...offset_to_grain_and_granularity__plan0.sql | 210 ++ ...rived_metric_with_offset_window__plan0.sql | 210 ++ ...h_offset_window_and_granularity__plan0.sql | 210 ++ ...fset_window_and_offset_to_grain__plan0.sql | 252 ++ ...offset_to_grain_and_granularity__plan0.sql | 252 ++ ...erived_offset_cumulative_metric__plan0.sql | 168 + ...et_metric_with_one_input_metric__plan0.sql | 126 + .../BigQuery/test_distinct_values__plan0.sql | 140 + .../BigQuery/test_filter_node__plan0.sql | 42 + ...lter_with_where_constraint_node__plan0.sql | 42 + ...th_where_constraint_on_join_dim__plan0.sql | 140 + .../test_join_to_scd_dimension__plan0.sql | 120 +- ...join_to_scd_dimension__plan0_optimized.sql | 4 +- ...spine_node_with_offset_to_grain__plan0.sql | 84 + ...e_spine_node_with_offset_window__plan0.sql | 84 + ..._time_spine_node_without_offset__plan0.sql | 84 + .../BigQuery/test_limit_rows__plan0.sql | 84 + ...al_dimension_using_local_entity__plan0.sql | 56 + .../test_measure_aggregation_node__plan0.sql | 42 + .../test_measure_constraint__plan0.sql | 364 ++ ..._constraint_with_reused_measure__plan0.sql | 168 + ...aint_with_single_expr_and_alias__plan0.sql | 84 + ..._multiple_sources_no_dimensions__plan0.sql | 140 + ...multi_hop_through_scd_dimension__plan0.sql | 197 +- ...through_scd_dimension__plan0_optimized.sql | 6 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 190 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 6 +- .../BigQuery/test_multi_join_node__plan0.sql | 98 + .../BigQuery/test_multihop_node__plan0.sql | 133 + ..._multiple_metrics_no_dimensions__plan0.sql | 210 ++ .../test_nested_derived_metric__plan0.sql | 336 ++ .../BigQuery/test_order_by_node__plan0.sql | 42 + .../BigQuery/test_partitioned_join__plan0.sql | 98 + .../test_semi_additive_join_node__plan0.sql | 42 + ...mi_additive_join_node__plan0_optimized.sql | 28 + ...dditive_join_node_with_grouping__plan0.sql | 42 + ...in_node_with_grouping__plan0_optimized.sql | 28 + ...join_node_with_queried_group_by__plan0.sql | 42 + ...with_queried_group_by__plan0_optimized.sql | 28 + .../BigQuery/test_single_join_node__plan0.sql | 70 + .../BigQuery/test_source_node__plan0.sql | 42 + .../test_source_node__plan0_optimized.sql | 42 + .../test_common_semantic_model__plan0.sql | 168 + .../test_compute_metrics_node__plan0.sql | 70 + ...o_from_multiple_semantic_models__plan0.sql | 252 ++ ...atio_from_single_semantic_model__plan0.sql | 70 + ...ompute_metrics_node_simple_expr__plan0.sql | 70 + .../test_constrain_time_range_node__plan0.sql | 42 + .../test_cumulative_metric__plan0.sql | 28 + ...cumulative_metric_grain_to_date__plan0.sql | 28 + .../test_cumulative_metric_no_ds__plan0.sql | 28 + ...est_cumulative_metric_no_window__plan0.sql | 28 + ..._no_window_with_time_constraint__plan0.sql | 42 + ...ive_metric_with_time_constraint__plan0.sql | 42 + .../Databricks/test_derived_metric__plan0.sql | 168 + ...ved_metric_with_offset_to_grain__plan0.sql | 210 ++ ...offset_to_grain_and_granularity__plan0.sql | 210 ++ ...rived_metric_with_offset_window__plan0.sql | 210 ++ ...h_offset_window_and_granularity__plan0.sql | 210 ++ ...fset_window_and_offset_to_grain__plan0.sql | 252 ++ ...offset_to_grain_and_granularity__plan0.sql | 252 ++ ...erived_offset_cumulative_metric__plan0.sql | 168 + ...et_metric_with_one_input_metric__plan0.sql | 126 + .../test_distinct_values__plan0.sql | 140 + .../Databricks/test_filter_node__plan0.sql | 42 + ...lter_with_where_constraint_node__plan0.sql | 42 + ...th_where_constraint_on_join_dim__plan0.sql | 140 + .../test_join_to_scd_dimension__plan0.sql | 126 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 84 + ...e_spine_node_with_offset_window__plan0.sql | 84 + ..._time_spine_node_without_offset__plan0.sql | 84 + .../Databricks/test_limit_rows__plan0.sql | 84 + ...al_dimension_using_local_entity__plan0.sql | 56 + .../test_measure_aggregation_node__plan0.sql | 42 + .../test_measure_constraint__plan0.sql | 364 ++ ..._constraint_with_reused_measure__plan0.sql | 168 + ...aint_with_single_expr_and_alias__plan0.sql | 84 + ..._multiple_sources_no_dimensions__plan0.sql | 140 + ...multi_hop_through_scd_dimension__plan0.sql | 203 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 196 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 10 +- .../test_multi_join_node__plan0.sql | 98 + .../Databricks/test_multihop_node__plan0.sql | 133 + ..._multiple_metrics_no_dimensions__plan0.sql | 210 ++ .../test_nested_derived_metric__plan0.sql | 336 ++ .../Databricks/test_order_by_node__plan0.sql | 42 + .../test_partitioned_join__plan0.sql | 98 + .../test_semi_additive_join_node__plan0.sql | 42 + ...mi_additive_join_node__plan0_optimized.sql | 28 + ...dditive_join_node_with_grouping__plan0.sql | 42 + ...in_node_with_grouping__plan0_optimized.sql | 28 + ...join_node_with_queried_group_by__plan0.sql | 42 + ...with_queried_group_by__plan0_optimized.sql | 28 + .../test_single_join_node__plan0.sql | 70 + .../Databricks/test_source_node__plan0.sql | 42 + .../test_source_node__plan0_optimized.sql | 42 + .../test_common_semantic_model__plan0.sql | 168 + .../test_compute_metrics_node__plan0.sql | 70 + ...o_from_multiple_semantic_models__plan0.sql | 252 ++ ...atio_from_single_semantic_model__plan0.sql | 70 + ...ompute_metrics_node_simple_expr__plan0.sql | 70 + .../test_constrain_time_range_node__plan0.sql | 42 + .../DuckDB/test_cumulative_metric__plan0.sql | 28 + ...cumulative_metric_grain_to_date__plan0.sql | 28 + .../test_cumulative_metric_no_ds__plan0.sql | 28 + ...est_cumulative_metric_no_window__plan0.sql | 28 + ..._no_window_with_time_constraint__plan0.sql | 42 + ...ive_metric_with_time_constraint__plan0.sql | 42 + .../DuckDB/test_derived_metric__plan0.sql | 168 + ...ved_metric_with_offset_to_grain__plan0.sql | 210 ++ ...offset_to_grain_and_granularity__plan0.sql | 210 ++ ...rived_metric_with_offset_window__plan0.sql | 210 ++ ...h_offset_window_and_granularity__plan0.sql | 210 ++ ...fset_window_and_offset_to_grain__plan0.sql | 252 ++ ...offset_to_grain_and_granularity__plan0.sql | 252 ++ ...erived_offset_cumulative_metric__plan0.sql | 168 + ...et_metric_with_one_input_metric__plan0.sql | 126 + .../DuckDB/test_distinct_values__plan0.sql | 140 + .../DuckDB/test_filter_node__plan0.sql | 42 + ...lter_with_where_constraint_node__plan0.sql | 42 + ...th_where_constraint_on_join_dim__plan0.sql | 140 + .../test_join_to_scd_dimension__plan0.sql | 126 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 84 + ...e_spine_node_with_offset_window__plan0.sql | 84 + ..._time_spine_node_without_offset__plan0.sql | 84 + .../DuckDB/test_limit_rows__plan0.sql | 84 + ...al_dimension_using_local_entity__plan0.sql | 56 + .../test_measure_aggregation_node__plan0.sql | 42 + .../DuckDB/test_measure_constraint__plan0.sql | 364 ++ ..._constraint_with_reused_measure__plan0.sql | 168 + ...aint_with_single_expr_and_alias__plan0.sql | 84 + ..._multiple_sources_no_dimensions__plan0.sql | 140 + ...multi_hop_through_scd_dimension__plan0.sql | 203 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 190 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 6 +- .../DuckDB/test_multi_join_node__plan0.sql | 98 + .../DuckDB/test_multihop_node__plan0.sql | 133 + ..._multiple_metrics_no_dimensions__plan0.sql | 210 ++ .../test_nested_derived_metric__plan0.sql | 336 ++ .../DuckDB/test_order_by_node__plan0.sql | 42 + .../DuckDB/test_partitioned_join__plan0.sql | 98 + .../test_semi_additive_join_node__plan0.sql | 42 + ...mi_additive_join_node__plan0_optimized.sql | 28 + ...dditive_join_node_with_grouping__plan0.sql | 42 + ...in_node_with_grouping__plan0_optimized.sql | 28 + ...join_node_with_queried_group_by__plan0.sql | 42 + ...with_queried_group_by__plan0_optimized.sql | 28 + .../DuckDB/test_single_join_node__plan0.sql | 70 + .../DuckDB/test_source_node__plan0.sql | 42 + .../test_source_node__plan0_optimized.sql | 42 + .../test_common_semantic_model__plan0.sql | 168 + .../test_compute_metrics_node__plan0.sql | 70 + ...o_from_multiple_semantic_models__plan0.sql | 252 ++ ...atio_from_single_semantic_model__plan0.sql | 70 + ...ompute_metrics_node_simple_expr__plan0.sql | 70 + .../test_constrain_time_range_node__plan0.sql | 42 + .../test_cumulative_metric__plan0.sql | 28 + ...cumulative_metric_grain_to_date__plan0.sql | 28 + .../test_cumulative_metric_no_ds__plan0.sql | 28 + ...est_cumulative_metric_no_window__plan0.sql | 28 + ..._no_window_with_time_constraint__plan0.sql | 42 + ...ive_metric_with_time_constraint__plan0.sql | 42 + .../Postgres/test_derived_metric__plan0.sql | 168 + ...ved_metric_with_offset_to_grain__plan0.sql | 210 ++ ...offset_to_grain_and_granularity__plan0.sql | 210 ++ ...rived_metric_with_offset_window__plan0.sql | 210 ++ ...h_offset_window_and_granularity__plan0.sql | 210 ++ ...fset_window_and_offset_to_grain__plan0.sql | 252 ++ ...offset_to_grain_and_granularity__plan0.sql | 252 ++ ...erived_offset_cumulative_metric__plan0.sql | 168 + ...et_metric_with_one_input_metric__plan0.sql | 126 + .../Postgres/test_distinct_values__plan0.sql | 140 + .../Postgres/test_filter_node__plan0.sql | 42 + ...lter_with_where_constraint_node__plan0.sql | 42 + ...th_where_constraint_on_join_dim__plan0.sql | 140 + .../test_join_to_scd_dimension__plan0.sql | 118 +- ...join_to_scd_dimension__plan0_optimized.sql | 2 +- ...spine_node_with_offset_to_grain__plan0.sql | 84 + ...e_spine_node_with_offset_window__plan0.sql | 84 + ..._time_spine_node_without_offset__plan0.sql | 84 + .../Postgres/test_limit_rows__plan0.sql | 84 + ...al_dimension_using_local_entity__plan0.sql | 56 + .../test_measure_aggregation_node__plan0.sql | 42 + .../test_measure_constraint__plan0.sql | 364 ++ ..._constraint_with_reused_measure__plan0.sql | 168 + ...aint_with_single_expr_and_alias__plan0.sql | 84 + ..._multiple_sources_no_dimensions__plan0.sql | 140 + ...multi_hop_through_scd_dimension__plan0.sql | 195 +- ...through_scd_dimension__plan0_optimized.sql | 4 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 196 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 10 +- .../Postgres/test_multi_join_node__plan0.sql | 98 + .../Postgres/test_multihop_node__plan0.sql | 133 + ..._multiple_metrics_no_dimensions__plan0.sql | 210 ++ .../test_nested_derived_metric__plan0.sql | 336 ++ .../Postgres/test_order_by_node__plan0.sql | 42 + .../Postgres/test_partitioned_join__plan0.sql | 98 + .../test_semi_additive_join_node__plan0.sql | 42 + ...mi_additive_join_node__plan0_optimized.sql | 28 + ...dditive_join_node_with_grouping__plan0.sql | 42 + ...in_node_with_grouping__plan0_optimized.sql | 28 + ...join_node_with_queried_group_by__plan0.sql | 42 + ...with_queried_group_by__plan0_optimized.sql | 28 + .../Postgres/test_single_join_node__plan0.sql | 70 + .../Postgres/test_source_node__plan0.sql | 42 + .../test_source_node__plan0_optimized.sql | 42 + .../test_common_semantic_model__plan0.sql | 168 + .../test_compute_metrics_node__plan0.sql | 70 + ...o_from_multiple_semantic_models__plan0.sql | 252 ++ ...atio_from_single_semantic_model__plan0.sql | 70 + ...ompute_metrics_node_simple_expr__plan0.sql | 70 + .../test_constrain_time_range_node__plan0.sql | 42 + .../test_cumulative_metric__plan0.sql | 28 + ...cumulative_metric_grain_to_date__plan0.sql | 28 + .../test_cumulative_metric_no_ds__plan0.sql | 28 + ...est_cumulative_metric_no_window__plan0.sql | 28 + ..._no_window_with_time_constraint__plan0.sql | 42 + ...ive_metric_with_time_constraint__plan0.sql | 42 + .../Redshift/test_derived_metric__plan0.sql | 168 + ...ved_metric_with_offset_to_grain__plan0.sql | 210 ++ ...offset_to_grain_and_granularity__plan0.sql | 210 ++ ...rived_metric_with_offset_window__plan0.sql | 210 ++ ...h_offset_window_and_granularity__plan0.sql | 210 ++ ...fset_window_and_offset_to_grain__plan0.sql | 252 ++ ...offset_to_grain_and_granularity__plan0.sql | 252 ++ ...erived_offset_cumulative_metric__plan0.sql | 168 + ...et_metric_with_one_input_metric__plan0.sql | 126 + .../Redshift/test_distinct_values__plan0.sql | 140 + .../Redshift/test_filter_node__plan0.sql | 42 + ...lter_with_where_constraint_node__plan0.sql | 42 + ...th_where_constraint_on_join_dim__plan0.sql | 140 + .../test_join_to_scd_dimension__plan0.sql | 126 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 84 + ...e_spine_node_with_offset_window__plan0.sql | 84 + ..._time_spine_node_without_offset__plan0.sql | 84 + .../Redshift/test_limit_rows__plan0.sql | 84 + ...al_dimension_using_local_entity__plan0.sql | 56 + .../test_measure_aggregation_node__plan0.sql | 42 + .../test_measure_constraint__plan0.sql | 364 ++ ..._constraint_with_reused_measure__plan0.sql | 168 + ...aint_with_single_expr_and_alias__plan0.sql | 84 + ..._multiple_sources_no_dimensions__plan0.sql | 140 + ...multi_hop_through_scd_dimension__plan0.sql | 203 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 196 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 10 +- .../Redshift/test_multi_join_node__plan0.sql | 98 + .../Redshift/test_multihop_node__plan0.sql | 133 + ..._multiple_metrics_no_dimensions__plan0.sql | 210 ++ .../test_nested_derived_metric__plan0.sql | 336 ++ .../Redshift/test_order_by_node__plan0.sql | 42 + .../Redshift/test_partitioned_join__plan0.sql | 98 + .../test_semi_additive_join_node__plan0.sql | 42 + ...mi_additive_join_node__plan0_optimized.sql | 28 + ...dditive_join_node_with_grouping__plan0.sql | 42 + ...in_node_with_grouping__plan0_optimized.sql | 28 + ...join_node_with_queried_group_by__plan0.sql | 42 + ...with_queried_group_by__plan0_optimized.sql | 28 + .../Redshift/test_single_join_node__plan0.sql | 70 + .../Redshift/test_source_node__plan0.sql | 42 + .../test_source_node__plan0_optimized.sql | 42 + .../test_common_semantic_model__plan0.sql | 168 + .../test_compute_metrics_node__plan0.sql | 70 + ...o_from_multiple_semantic_models__plan0.sql | 252 ++ ...atio_from_single_semantic_model__plan0.sql | 70 + ...ompute_metrics_node_simple_expr__plan0.sql | 70 + .../test_constrain_time_range_node__plan0.sql | 42 + .../test_cumulative_metric__plan0.sql | 28 + ...cumulative_metric_grain_to_date__plan0.sql | 28 + .../test_cumulative_metric_no_ds__plan0.sql | 28 + ...est_cumulative_metric_no_window__plan0.sql | 28 + ..._no_window_with_time_constraint__plan0.sql | 42 + ...ive_metric_with_time_constraint__plan0.sql | 42 + .../Snowflake/test_derived_metric__plan0.sql | 168 + ...ved_metric_with_offset_to_grain__plan0.sql | 210 ++ ...offset_to_grain_and_granularity__plan0.sql | 210 ++ ...rived_metric_with_offset_window__plan0.sql | 210 ++ ...h_offset_window_and_granularity__plan0.sql | 210 ++ ...fset_window_and_offset_to_grain__plan0.sql | 252 ++ ...offset_to_grain_and_granularity__plan0.sql | 252 ++ ...erived_offset_cumulative_metric__plan0.sql | 168 + ...et_metric_with_one_input_metric__plan0.sql | 126 + .../Snowflake/test_distinct_values__plan0.sql | 140 + .../Snowflake/test_filter_node__plan0.sql | 42 + ...lter_with_where_constraint_node__plan0.sql | 42 + ...th_where_constraint_on_join_dim__plan0.sql | 140 + .../test_join_to_scd_dimension__plan0.sql | 126 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 84 + ...e_spine_node_with_offset_window__plan0.sql | 84 + ..._time_spine_node_without_offset__plan0.sql | 84 + .../Snowflake/test_limit_rows__plan0.sql | 84 + ...al_dimension_using_local_entity__plan0.sql | 56 + .../test_measure_aggregation_node__plan0.sql | 42 + .../test_measure_constraint__plan0.sql | 364 ++ ..._constraint_with_reused_measure__plan0.sql | 168 + ...aint_with_single_expr_and_alias__plan0.sql | 84 + ..._multiple_sources_no_dimensions__plan0.sql | 140 + ...multi_hop_through_scd_dimension__plan0.sql | 203 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 196 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 10 +- .../Snowflake/test_multi_join_node__plan0.sql | 98 + .../Snowflake/test_multihop_node__plan0.sql | 133 + ..._multiple_metrics_no_dimensions__plan0.sql | 210 ++ .../test_nested_derived_metric__plan0.sql | 336 ++ .../Snowflake/test_order_by_node__plan0.sql | 42 + .../test_partitioned_join__plan0.sql | 98 + .../test_semi_additive_join_node__plan0.sql | 42 + ...mi_additive_join_node__plan0_optimized.sql | 28 + ...dditive_join_node_with_grouping__plan0.sql | 42 + ...in_node_with_grouping__plan0_optimized.sql | 28 + ...join_node_with_queried_group_by__plan0.sql | 42 + ...with_queried_group_by__plan0_optimized.sql | 28 + .../test_single_join_node__plan0.sql | 70 + .../Snowflake/test_source_node__plan0.sql | 42 + .../test_source_node__plan0_optimized.sql | 42 + .../test_common_semantic_model__plan0.xml | 1348 ++++++-- .../test_compute_metrics_node__plan0.xml | 476 ++- ...o_from_multiple_semantic_models__plan0.xml | 2076 +++++++++--- ...atio_from_single_semantic_model__plan0.xml | 476 ++- ...ompute_metrics_node_simple_expr__plan0.xml | 476 ++- .../test_constrain_time_range_node__plan0.xml | 282 +- .../test_cumulative_metric__plan0.xml | 208 +- ...cumulative_metric_grain_to_date__plan0.xml | 208 +- .../test_cumulative_metric_no_ds__plan0.xml | 200 +- ...est_cumulative_metric_no_window__plan0.xml | 208 +- ..._no_window_with_time_constraint__plan0.xml | 324 +- ...ive_metric_with_time_constraint__plan0.xml | 324 +- .../test_derived_metric__plan0.xml | 1354 ++++++-- ...ved_metric_with_offset_to_grain__plan0.xml | 1718 +++++++--- ...offset_to_grain_and_granularity__plan0.xml | 1716 +++++++--- ...rived_metric_with_offset_window__plan0.xml | 1718 +++++++--- ...h_offset_window_and_granularity__plan0.xml | 1716 +++++++--- ...fset_window_and_offset_to_grain__plan0.xml | 2094 +++++++++--- ...offset_to_grain_and_granularity__plan0.xml | 2090 +++++++++--- ...erived_offset_cumulative_metric__plan0.xml | 1420 +++++--- ...et_metric_with_one_input_metric__plan0.xml | 1040 ++++-- .../test_distinct_values__plan0.xml | 1132 +++++-- .../SqlQueryPlan/test_filter_node__plan0.xml | 282 +- ...lter_with_where_constraint_node__plan0.xml | 282 +- ...th_where_constraint_on_join_dim__plan0.xml | 1142 +++++-- .../test_join_to_scd_dimension__plan0.xml | 892 +++-- ...spine_node_with_offset_to_grain__plan0.xml | 642 +++- ...e_spine_node_with_offset_window__plan0.xml | 642 +++- ..._time_spine_node_without_offset__plan0.xml | 642 +++- .../SqlQueryPlan/test_limit_rows__plan0.xml | 678 +++- ...al_dimension_using_local_entity__plan0.xml | 450 ++- .../test_measure_aggregation_node__plan0.xml | 282 +- .../test_measure_constraint__plan0.xml | 2974 ++++++++++++----- ..._constraint_with_reused_measure__plan0.xml | 1366 ++++++-- ...aint_with_single_expr_and_alias__plan0.xml | 688 +++- ..._multiple_sources_no_dimensions__plan0.xml | 1112 ++++-- ...multi_hop_through_scd_dimension__plan0.xml | 1332 ++++++-- ...test_multi_hop_to_scd_dimension__plan0.xml | 1192 +++++-- .../test_multi_join_node__plan0.xml | 666 +++- .../test_multihop_node__plan0.xml | 996 ++++-- ..._multiple_metrics_no_dimensions__plan0.xml | 1908 ++++++++--- .../test_nested_derived_metric__plan0.xml | 2722 +++++++++++---- .../test_order_by_node__plan0.xml | 282 +- .../test_partitioned_join__plan0.xml | 670 +++- .../test_semi_additive_join_node__plan0.xml | 246 +- ...dditive_join_node_with_grouping__plan0.xml | 246 +- ...join_node_with_queried_group_by__plan0.xml | 246 +- .../test_single_join_node__plan0.xml | 476 ++- .../SqlQueryPlan/test_source_node__plan0.xml | 282 +- ...orm_node_using_non_primary_time__plan0.sql | 84 + ...sing_non_primary_time__plan0_optimized.sql | 42 + ...ansform_node_using_primary_time__plan0.sql | 84 + ...de_using_primary_time__plan0_optimized.sql | 42 + ...uery_with_metric_time_dimension__plan0.sql | 168 + ...orm_node_using_non_primary_time__plan0.sql | 84 + ...sing_non_primary_time__plan0_optimized.sql | 42 + ...ansform_node_using_primary_time__plan0.sql | 84 + ...de_using_primary_time__plan0_optimized.sql | 42 + ...uery_with_metric_time_dimension__plan0.sql | 168 + ...orm_node_using_non_primary_time__plan0.sql | 84 + ...sing_non_primary_time__plan0_optimized.sql | 42 + ...ansform_node_using_primary_time__plan0.sql | 84 + ...de_using_primary_time__plan0_optimized.sql | 42 + ...uery_with_metric_time_dimension__plan0.sql | 168 + ...orm_node_using_non_primary_time__plan0.sql | 84 + ...sing_non_primary_time__plan0_optimized.sql | 42 + ...ansform_node_using_primary_time__plan0.sql | 84 + ...de_using_primary_time__plan0_optimized.sql | 42 + ...uery_with_metric_time_dimension__plan0.sql | 168 + ...orm_node_using_non_primary_time__plan0.sql | 84 + ...sing_non_primary_time__plan0_optimized.sql | 42 + ...ansform_node_using_primary_time__plan0.sql | 84 + ...de_using_primary_time__plan0_optimized.sql | 42 + ...uery_with_metric_time_dimension__plan0.sql | 168 + ...orm_node_using_non_primary_time__plan0.sql | 84 + ...sing_non_primary_time__plan0_optimized.sql | 42 + ...ansform_node_using_primary_time__plan0.sql | 84 + ...de_using_primary_time__plan0_optimized.sql | 42 + ...uery_with_metric_time_dimension__plan0.sql | 168 + ...orm_node_using_non_primary_time__plan0.xml | 526 ++- ...ansform_node_using_primary_time__plan0.xml | 550 ++- ...uery_with_metric_time_dimension__plan0.xml | 1300 +++++-- ...2_metrics_from_1_semantic_model__dfp_0.xml | 4 + ..._metrics_from_1_semantic_model__dfpo_0.xml | 2 + ..._metrics_from_2_semantic_models__dfp_0.xml | 2 + ...metrics_from_2_semantic_models__dfpo_0.xml | 2 + ...o_metrics_from_1_semantic_model__dfp_0.xml | 4 + ..._metrics_from_1_semantic_model__dfpo_0.xml | 1 + ..._metrics_from_2_semantic_models__dfp_0.xml | 3 + ...metrics_from_2_semantic_models__dfpo_0.xml | 2 + ...constrained_metric_not_combined__dfp_0.xml | 3 + ...onstrained_metric_not_combined__dfpo_0.xml | 3 + .../test_derived_metric__dfp_0.xml | 2 + .../test_derived_metric__dfpo_0.xml | 1 + ..._metric_with_non_derived_metric__dfp_0.xml | 3 + ...metric_with_non_derived_metric__dfpo_0.xml | 2 + .../test_nested_derived_metric__dfp_0.xml | 4 + .../test_nested_derived_metric__dfpo_0.xml | 2 + metricflow/time/date_part.py | 40 + metricflow/time/time_granularity.py | 22 +- 486 files changed, 76103 insertions(+), 12046 deletions(-) create mode 100644 metricflow/time/date_part.py diff --git a/metricflow/dag/id_generation.py b/metricflow/dag/id_generation.py index 913457a798..e08fca06de 100644 --- a/metricflow/dag/id_generation.py +++ b/metricflow/dag/id_generation.py @@ -35,6 +35,7 @@ SQL_EXPR_IS_NULL_PREFIX = "isn" SQL_EXPR_CAST_TO_TIMESTAMP_PREFIX = "ctt" SQL_EXPR_DATE_TRUNC = "dt" +SQL_EXPR_EXTRACT = "ex" SQL_EXPR_RATIO_COMPUTATION = "rc" SQL_EXPR_BETWEEN_PREFIX = "betw" SQL_EXPR_WINDOW_FUNCTION_ID_PREFIX = "wfnc" diff --git a/metricflow/dataset/convert_semantic_model.py b/metricflow/dataset/convert_semantic_model.py index 99a0ea74ea..296168df21 100644 --- a/metricflow/dataset/convert_semantic_model.py +++ b/metricflow/dataset/convert_semantic_model.py @@ -38,6 +38,7 @@ SqlColumnReferenceExpression, SqlDateTruncExpression, SqlExpressionNode, + SqlExtractExpression, SqlStringExpression, ) from metricflow.sql.sql_plan import ( @@ -46,6 +47,7 @@ SqlSelectStatementNode, SqlTableFromClauseNode, ) +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -102,12 +104,14 @@ def _create_time_dimension_instance( time_dimension: Dimension, entity_links: Tuple[EntityReference, ...], time_granularity: TimeGranularity = DEFAULT_TIME_GRANULARITY, + date_part: Optional[DatePart] = None, ) -> TimeDimensionInstance: """Create a time dimension instance from the dimension object from a semantic model in the model.""" time_dimension_spec = TimeDimensionSpec( element_name=time_dimension.reference.element_name, entity_links=entity_links, time_granularity=time_granularity, + date_part=date_part, ) return TimeDimensionInstance( @@ -219,6 +223,11 @@ def _convert_dimensions( select_columns = [] for dimension in dimensions or []: + dimension_select_expr = SemanticModelToDataSetConverter._make_element_sql_expr( + table_alias=table_alias, + element_name=dimension.reference.element_name, + element_expr=dimension.expr, + ) if dimension.type == DimensionType.CATEGORICAL: dimension_instance = self._create_dimension_instance( semantic_model_name=semantic_model_name, @@ -228,11 +237,7 @@ def _convert_dimensions( dimension_instances.append(dimension_instance) select_columns.append( SqlSelectColumn( - expr=SemanticModelToDataSetConverter._make_element_sql_expr( - table_alias=table_alias, - element_name=dimension.reference.element_name, - element_expr=dimension.expr, - ), + expr=dimension_select_expr, column_alias=dimension_instance.associated_column.column_name, ) ) @@ -251,11 +256,7 @@ def _convert_dimensions( time_dimension_instances.append(time_dimension_instance) select_columns.append( SqlSelectColumn( - expr=SemanticModelToDataSetConverter._make_element_sql_expr( - table_alias=table_alias, - element_name=dimension.reference.element_name, - element_expr=dimension.expr, - ), + expr=dimension_select_expr, column_alias=time_dimension_instance.associated_column.column_name, ) ) @@ -274,16 +275,31 @@ def _convert_dimensions( select_columns.append( SqlSelectColumn( expr=SqlDateTruncExpression( - time_granularity=time_granularity, - arg=SemanticModelToDataSetConverter._make_element_sql_expr( - table_alias=table_alias, - element_name=dimension.reference.element_name, - element_expr=dimension.expr, - ), + time_granularity=time_granularity, arg=dimension_select_expr ), column_alias=time_dimension_instance.associated_column.column_name, ) ) + + # Add all date part options for easy query resolution + for date_part in DatePart: + if date_part.to_int() >= defined_time_granularity.to_int(): + time_dimension_instance = self._create_time_dimension_instance( + semantic_model_name=semantic_model_name, + time_dimension=dimension, + entity_links=entity_links, + time_granularity=defined_time_granularity, + date_part=date_part, + ) + time_dimension_instances.append(time_dimension_instance) + + select_columns.append( + SqlSelectColumn( + expr=SqlExtractExpression(date_part=date_part, arg=dimension_select_expr), + column_alias=time_dimension_instance.associated_column.column_name, + ) + ) + else: assert False, f"Unhandled dimension type: {dimension.type}" diff --git a/metricflow/naming/linkable_spec_name.py b/metricflow/naming/linkable_spec_name.py index 082f81cb84..1cfe2b9804 100644 --- a/metricflow/naming/linkable_spec_name.py +++ b/metricflow/naming/linkable_spec_name.py @@ -6,6 +6,8 @@ from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity +from metricflow.time.date_part import DatePart + DUNDER = "__" logger = logging.getLogger(__name__) @@ -24,6 +26,7 @@ class StructuredLinkableSpecName: entity_link_names: Tuple[str, ...] element_name: str time_granularity: Optional[TimeGranularity] = None + date_part: Optional[DatePart] = None @staticmethod def from_name(qualified_name: str) -> StructuredLinkableSpecName: @@ -32,7 +35,26 @@ def from_name(qualified_name: str) -> StructuredLinkableSpecName: # No dunder, e.g. "ds" if len(name_parts) == 1: - return StructuredLinkableSpecName((), name_parts[0]) + return StructuredLinkableSpecName(entity_link_names=(), element_name=name_parts[0]) + + associated_date_part: Optional[DatePart] = None + for date_part in DatePart: + if name_parts[-1] == StructuredLinkableSpecName.date_part_suffix(date_part): + associated_date_part = date_part + + # Has a date_part + if associated_date_part: + # e.g. "ds__extract_month" + if len(name_parts) == 2: + return StructuredLinkableSpecName( + entity_link_names=(), element_name=name_parts[0], date_part=associated_date_part + ) + # e.g. "messages__ds__extract_month" + return StructuredLinkableSpecName( + entity_link_names=tuple(name_parts[:-2]), + element_name=name_parts[-2], + date_part=associated_date_part, + ) associated_granularity = None granularity: TimeGranularity @@ -44,19 +66,29 @@ def from_name(qualified_name: str) -> StructuredLinkableSpecName: if associated_granularity: # e.g. "ds__month" if len(name_parts) == 2: - return StructuredLinkableSpecName((), name_parts[0], associated_granularity) + return StructuredLinkableSpecName( + entity_link_names=(), element_name=name_parts[0], time_granularity=associated_granularity + ) # e.g. "messages__ds__month" - return StructuredLinkableSpecName(tuple(name_parts[:-2]), name_parts[-2], associated_granularity) + return StructuredLinkableSpecName( + entity_link_names=tuple(name_parts[:-2]), + element_name=name_parts[-2], + time_granularity=associated_granularity, + ) + # e.g. "messages__ds" else: - return StructuredLinkableSpecName(tuple(name_parts[:-1]), name_parts[-1]) + return StructuredLinkableSpecName(entity_link_names=tuple(name_parts[:-1]), element_name=name_parts[-1]) @property def qualified_name(self) -> str: """Return the full name form. e.g. ds or listing__ds__month.""" items = list(self.entity_link_names) + [self.element_name] - if self.time_granularity: + if self.date_part: + items.append(self.date_part_suffix(date_part=self.date_part)) + elif self.time_granularity: items.append(self.time_granularity.value) + return DUNDER.join(items) @property @@ -66,3 +98,8 @@ def entity_prefix(self) -> Optional[str]: return DUNDER.join(self.entity_link_names) return None + + @staticmethod + def date_part_suffix(date_part: DatePart) -> str: + """Suffix used for names with a date_part.""" + return f"extract_{date_part.value}" diff --git a/metricflow/plan_conversion/column_resolver.py b/metricflow/plan_conversion/column_resolver.py index 7dc1124aa4..9312fd7f30 100644 --- a/metricflow/plan_conversion/column_resolver.py +++ b/metricflow/plan_conversion/column_resolver.py @@ -55,6 +55,7 @@ def visit_time_dimension_spec(self, time_dimension_spec: TimeDimensionSpec) -> C entity_link_names=tuple(x.element_name for x in time_dimension_spec.entity_links), element_name=time_dimension_spec.element_name, time_granularity=time_dimension_spec.time_granularity, + date_part=time_dimension_spec.date_part, ).qualified_name return ColumnAssociation( diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index d350ff17e8..8f80437a08 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -1116,6 +1116,7 @@ def visit_metric_time_dimension_transform_node( if ( len(time_dimension_instance.spec.entity_links) == 0 and time_dimension_instance.spec.reference == node.aggregation_time_dimension_reference + and time_dimension_instance.spec.date_part is None ): matching_time_dimension_instances.append(time_dimension_instance) @@ -1141,6 +1142,7 @@ def visit_metric_time_dimension_transform_node( output_column_to_input_column[ metric_time_dimension_column_association.column_name ] = matching_time_dimension_instance.associated_column.column_name + output_instance_set = InstanceSet( measure_instances=tuple(output_measure_instances), dimension_instances=input_data_set.instance_set.dimension_instances, @@ -1359,7 +1361,7 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode[SourceDataSetT SqlColumnReference(table_alias=time_spine_alias, column_name=original_time_dim_instance.spec.qualified_name) ) - # Add requested granularities (skip for default granularity). + # Add requested granularities (skip for default granularity) and date_parts. metric_time_select_columns = [] metric_time_dimension_instances = [] where: Optional[SqlExpressionNode] = None @@ -1376,6 +1378,7 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode[SourceDataSetT element_name=original_time_dim_instance.spec.element_name, entity_links=original_time_dim_instance.spec.entity_links, time_granularity=metric_time_dimension_spec.time_granularity, + date_part=metric_time_dimension_spec.date_part, aggregation_state=original_time_dim_instance.spec.aggregation_state, ) time_dim_instance = TimeDimensionInstance( diff --git a/metricflow/plan_conversion/instance_converters.py b/metricflow/plan_conversion/instance_converters.py index 0620598c8d..d741d8f711 100644 --- a/metricflow/plan_conversion/instance_converters.py +++ b/metricflow/plan_conversion/instance_converters.py @@ -401,6 +401,7 @@ def transform(self, instance_set: InstanceSet) -> InstanceSet: # noqa: D + time_dimension_instance.spec.entity_links ), time_granularity=time_dimension_instance.spec.time_granularity, + date_part=time_dimension_instance.spec.date_part, ) time_dimension_instances_with_additional_link.append( TimeDimensionInstance( diff --git a/metricflow/specs/specs.py b/metricflow/specs/specs.py index 46e071a30b..f065c0d693 100644 --- a/metricflow/specs/specs.py +++ b/metricflow/specs/specs.py @@ -34,6 +34,7 @@ from metricflow.naming.linkable_spec_name import StructuredLinkableSpecName from metricflow.sql.sql_bind_parameters import SqlBindParameters from metricflow.sql.sql_column_type import SqlColumnType +from metricflow.time.date_part import DatePart from metricflow.visitor import VisitorOutputT @@ -284,6 +285,7 @@ def accept(self, visitor: InstanceSpecVisitor[VisitorOutputT]) -> VisitorOutputT @dataclass(frozen=True) class TimeDimensionSpec(DimensionSpec): # noqa: D time_granularity: TimeGranularity = DEFAULT_TIME_GRANULARITY + date_part: Optional[DatePart] = None # Used for semi-additive joins. Some more thought is needed, but this may be useful in InstanceSpec. aggregation_state: Optional[AggregationState] = None @@ -295,6 +297,7 @@ def without_first_entity_link(self) -> TimeDimensionSpec: # noqa: D element_name=self.element_name, entity_links=self.entity_links[1:], time_granularity=self.time_granularity, + date_part=self.date_part, ) @property @@ -338,6 +341,7 @@ def with_aggregation_state(self, aggregation_state: AggregationState) -> TimeDim element_name=self.element_name, entity_links=self.entity_links, time_granularity=self.time_granularity, + date_part=self.date_part, aggregation_state=aggregation_state, ) diff --git a/metricflow/specs/where_filter_time_dimension.py b/metricflow/specs/where_filter_time_dimension.py index 18ed235a81..0dd23ad0d4 100644 --- a/metricflow/specs/where_filter_time_dimension.py +++ b/metricflow/specs/where_filter_time_dimension.py @@ -86,4 +86,6 @@ def _convert_to_time_dimension_spec( element_name=parameter_set.time_dimension_reference.element_name, entity_links=parameter_set.entity_path, time_granularity=parameter_set.time_granularity, + # TODO: add date_part to TimeDimensionCallParameterSet in DSI + # date_part=parameter_set.date_part, ) diff --git a/metricflow/sql/render/databricks.py b/metricflow/sql/render/databricks.py index 0740f66350..307f15ba24 100644 --- a/metricflow/sql/render/databricks.py +++ b/metricflow/sql/render/databricks.py @@ -13,6 +13,7 @@ ) from metricflow.sql.render.sql_plan_renderer import DefaultSqlQueryPlanRenderer from metricflow.sql.sql_exprs import SqlPercentileExpression, SqlPercentileFunctionType +from metricflow.time.date_part import DatePart class DatabricksSqlExpressionRenderer(DefaultSqlExpressionRenderer): @@ -56,6 +57,13 @@ def visit_percentile_expr(self, node: SqlPercentileExpression) -> SqlExpressionR bind_parameters=params, ) + @override + def render_date_part(self, date_part: DatePart) -> str: + if date_part == DatePart.DAYOFYEAR: + return "DOY" + + return super().render_date_part(date_part) + class DatabricksSqlQueryPlanRenderer(DefaultSqlQueryPlanRenderer): """Plan renderer for the Snowflake engine.""" diff --git a/metricflow/sql/render/expr_renderer.py b/metricflow/sql/render/expr_renderer.py index 26a4e0065c..105c83e862 100644 --- a/metricflow/sql/render/expr_renderer.py +++ b/metricflow/sql/render/expr_renderer.py @@ -22,6 +22,7 @@ SqlDateTruncExpression, SqlExpressionNode, SqlExpressionNodeVisitor, + SqlExtractExpression, SqlFunction, SqlGenerateUuidExpression, SqlIsNullExpression, @@ -36,6 +37,7 @@ SqlWindowFunctionExpression, ) from metricflow.sql.sql_plan import SqlSelectColumn +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -267,6 +269,18 @@ def visit_date_trunc_expr(self, node: SqlDateTruncExpression) -> SqlExpressionRe bind_parameters=arg_rendered.bind_parameters, ) + def visit_extract_expr(self, node: SqlExtractExpression) -> SqlExpressionRenderResult: # noqa: D + arg_rendered = self.render_sql_expr(node.arg) + + return SqlExpressionRenderResult( + sql=f"EXTRACT({self.render_date_part(node.date_part)} FROM {arg_rendered.sql})", + bind_parameters=arg_rendered.bind_parameters, + ) + + def render_date_part(self, date_part: DatePart) -> str: + """Render DATE PART for an EXTRACT expression.""" + return date_part.name + def visit_time_delta_expr(self, node: SqlTimeDeltaExpression) -> SqlExpressionRenderResult: # noqa: D arg_rendered = node.arg.accept(self) if node.grain_to_date: diff --git a/metricflow/sql/sql_exprs.py b/metricflow/sql/sql_exprs.py index 10e72826aa..8ab96a29e9 100644 --- a/metricflow/sql/sql_exprs.py +++ b/metricflow/sql/sql_exprs.py @@ -19,6 +19,7 @@ SQL_EXPR_COLUMN_REFERENCE_ID_PREFIX, SQL_EXPR_COMPARISON_ID_PREFIX, SQL_EXPR_DATE_TRUNC, + SQL_EXPR_EXTRACT, SQL_EXPR_FUNCTION_ID_PREFIX, SQL_EXPR_GENERATE_UUID_PREFIX, SQL_EXPR_IS_NULL_PREFIX, @@ -32,6 +33,7 @@ ) from metricflow.dag.mf_dag import DagNode, DisplayedProperty, NodeId from metricflow.sql.sql_bind_parameters import SqlBindParameters +from metricflow.time.date_part import DatePart from metricflow.visitor import Visitable, VisitorOutputT @@ -218,6 +220,10 @@ def visit_cast_to_timestamp_expr(self, node: SqlCastToTimestampExpression) -> Vi def visit_date_trunc_expr(self, node: SqlDateTruncExpression) -> VisitorOutputT: # noqa: D pass + @abstractmethod + def visit_extract_expr(self, node: SqlExtractExpression) -> VisitorOutputT: # noqa: D + pass + @abstractmethod def visit_time_delta_expr(self, node: SqlTimeDeltaExpression) -> VisitorOutputT: # noqa: D pass @@ -1416,6 +1422,64 @@ def matches(self, other: SqlExpressionNode) -> bool: # noqa: D return self.time_granularity == other.time_granularity and self._parents_match(other) +class SqlExtractExpression(SqlExpressionNode): + """Extract a date part from a time expression.""" + + def __init__(self, date_part: DatePart, arg: SqlExpressionNode) -> None: + """Constructor. + + Args: + date_part: the date part to extract. + arg: the expression to extract from. + """ + self._date_part = date_part + super().__init__(node_id=self.create_unique_id(), parent_nodes=[arg]) + + @classmethod + def id_prefix(cls) -> str: # noqa: D + return SQL_EXPR_EXTRACT + + @property + def requires_parenthesis(self) -> bool: # noqa: D + return False + + def accept(self, visitor: SqlExpressionNodeVisitor[VisitorOutputT]) -> VisitorOutputT: # noqa: D + return visitor.visit_extract_expr(self) + + @property + def description(self) -> str: # noqa: D + return f"Extract {self.date_part.name}" + + @property + def date_part(self) -> DatePart: # noqa: D + return self._date_part + + @property + def arg(self) -> SqlExpressionNode: # noqa: D + assert len(self.parent_nodes) == 1 + return self.parent_nodes[0] + + def rewrite( # noqa: D + self, + column_replacements: Optional[SqlColumnReplacements] = None, + should_render_table_alias: Optional[bool] = None, + ) -> SqlExpressionNode: + return SqlExtractExpression( + date_part=self.date_part, arg=self.arg.rewrite(column_replacements, should_render_table_alias) + ) + + @property + def lineage(self) -> SqlExpressionTreeLineage: # noqa: D + return SqlExpressionTreeLineage.combine( + tuple(x.lineage for x in self.parent_nodes) + (SqlExpressionTreeLineage(other_exprs=(self,)),) + ) + + def matches(self, other: SqlExpressionNode) -> bool: # noqa: D + if not isinstance(other, SqlExtractExpression): + return False + return self.date_part == other.date_part and self._parents_match(other) + + class SqlRatioComputationExpression(SqlExpressionNode): """Node for expressing Ratio metrics to allow for appropriate casting to float/double in each engine. diff --git a/metricflow/test/dataset/test_convert_semantic_model.py b/metricflow/test/dataset/test_convert_semantic_model.py index 3335742f2a..d830438ea5 100644 --- a/metricflow/test/dataset/test_convert_semantic_model.py +++ b/metricflow/test/dataset/test_convert_semantic_model.py @@ -19,6 +19,7 @@ from metricflow.test.fixtures.model_fixtures import ConsistentIdObjectRepository from metricflow.test.fixtures.setup_fixtures import MetricFlowTestSessionState from metricflow.test.sql.compare_sql_plan import assert_rendered_sql_equal +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -49,6 +50,27 @@ def test_convert_table_semantic_model_without_measures( # noqa: D TimeDimensionSpec(element_name="ds", entity_links=(), time_granularity=TimeGranularity.MONTH), TimeDimensionSpec(element_name="ds", entity_links=(), time_granularity=TimeGranularity.QUARTER), TimeDimensionSpec(element_name="ds", entity_links=(), time_granularity=TimeGranularity.YEAR), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.YEAR + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.QUARTER + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.MONTH + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.WEEK + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAY + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFWEEK + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFYEAR + ), TimeDimensionSpec( element_name="ds", entity_links=(EntityReference(element_name="user"),), @@ -74,6 +96,48 @@ def test_convert_table_semantic_model_without_measures( # noqa: D entity_links=(EntityReference(element_name="user"),), time_granularity=TimeGranularity.YEAR, ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.YEAR, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.QUARTER, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.MONTH, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.WEEK, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAY, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFWEEK, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="user"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFYEAR, + ), ), ) @@ -125,11 +189,74 @@ def test_convert_table_semantic_model_with_measures( # noqa: D TimeDimensionSpec(element_name="ds", entity_links=(), time_granularity=TimeGranularity.MONTH), TimeDimensionSpec(element_name="ds", entity_links=(), time_granularity=TimeGranularity.QUARTER), TimeDimensionSpec(element_name="ds", entity_links=(), time_granularity=TimeGranularity.YEAR), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.YEAR + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.QUARTER + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.MONTH + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.WEEK + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAY + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFWEEK + ), + TimeDimensionSpec( + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFYEAR + ), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.DAY), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.WEEK), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.MONTH), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.QUARTER), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.YEAR), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.YEAR, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.QUARTER, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.MONTH, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.WEEK, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAY, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFWEEK, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFYEAR, + ), TimeDimensionSpec( element_name="ds", entity_links=(EntityReference(element_name="verification"),), @@ -155,6 +282,48 @@ def test_convert_table_semantic_model_with_measures( # noqa: D entity_links=(EntityReference(element_name="verification"),), time_granularity=TimeGranularity.YEAR, ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.YEAR, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.QUARTER, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.MONTH, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.WEEK, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAY, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFWEEK, + ), + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFYEAR, + ), TimeDimensionSpec( element_name="ds_partitioned", entity_links=(EntityReference(element_name="verification"),), @@ -180,6 +349,48 @@ def test_convert_table_semantic_model_with_measures( # noqa: D entity_links=(EntityReference(element_name="verification"),), time_granularity=TimeGranularity.YEAR, ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.YEAR, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.QUARTER, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.MONTH, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.WEEK, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAY, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFWEEK, + ), + TimeDimensionSpec( + element_name="ds_partitioned", + entity_links=(EntityReference(element_name="verification"),), + time_granularity=TimeGranularity.DAY, + date_part=DatePart.DAYOFYEAR, + ), ), ) diff --git a/metricflow/test/model/test_data_warehouse_tasks.py b/metricflow/test/model/test_data_warehouse_tasks.py index 1c66625f22..3675751f40 100644 --- a/metricflow/test/model/test_data_warehouse_tasks.py +++ b/metricflow/test/model/test_data_warehouse_tasks.py @@ -110,8 +110,8 @@ def test_build_dimension_tasks( # noqa: D ) # on semantic model query with all dimensions assert len(tasks) == 1 - # 1 categorical dimension task, 1 time dimension task, 4 granularity based time dimension tasks - assert len(tasks[0].on_fail_subtasks) == 6 + # 1 categorical dimension task, 1 time dimension task, 4 granularity based time dimension tasks, 7 date_part tasks + assert len(tasks[0].on_fail_subtasks) == 13 def test_validate_dimensions( # noqa: D diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql index bf1aa949c1..6a18fb55ab 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql @@ -6,11 +6,25 @@ SELECT , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql index c2ce705484..be4db1864b 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,22 +6,50 @@ SELECT , DATE_TRUNC(id_verifications_src_10003.ds, month) AS ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week , DATE_TRUNC(id_verifications_src_10003.ds, month) AS verification__ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS verification__ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS verification__ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql index 73911c3dd1..b4f8805489 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,12 +5,26 @@ SELECT , DATE_TRUNC(users_latest_src_10008.ds, month) AS ds__month , DATE_TRUNC(users_latest_src_10008.ds, quarter) AS ds__quarter , DATE_TRUNC(users_latest_src_10008.ds, year) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC(users_latest_src_10008.ds, isoweek) AS user__ds__week , DATE_TRUNC(users_latest_src_10008.ds, month) AS user__ds__month , DATE_TRUNC(users_latest_src_10008.ds, quarter) AS user__ds__quarter , DATE_TRUNC(users_latest_src_10008.ds, year) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql index 896ee2afd1..28bd5c725b 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql @@ -6,11 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql index cfaaed9f09..dbb952f05b 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,22 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql index 75e1612840..60db7389f0 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,12 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM users_latest_src_10008.ds) AS ds__extract_dayofyear , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek + , EXTRACT(DOY FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql index 896ee2afd1..390e922160 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql @@ -6,11 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql index cfaaed9f09..4a4b1f53f4 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,22 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql index 75e1612840..e3f2a1d31a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,12 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql index 896ee2afd1..390e922160 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql @@ -6,11 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql index cfaaed9f09..4a4b1f53f4 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,22 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql index 75e1612840..e3f2a1d31a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,12 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql index 896ee2afd1..390e922160 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql @@ -6,11 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql index cfaaed9f09..4a4b1f53f4 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,22 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql index 75e1612840..e3f2a1d31a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,12 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql index 896ee2afd1..390e922160 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql @@ -6,11 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql index cfaaed9f09..4a4b1f53f4 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,22 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql index 75e1612840..e3f2a1d31a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,12 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml index ff4e3095e1..fea487abac 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_common_semantic_model__dfp_0.xml @@ -34,6 +34,7 @@ + @@ -65,6 +66,7 @@ + @@ -132,6 +134,7 @@ + @@ -163,6 +166,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml index 4aac7f8a75..315dbe3f63 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_no_window_or_grain_with_metric_time__dfp_0.xml @@ -29,6 +29,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml index 3d6d6e3630..8c87a7ea7c 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_cumulative_metric_with_window__dfp_0.xml @@ -29,6 +29,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml index babc67f7c8..0ea5b4678a 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_to_grain__dfp_0.xml @@ -43,6 +43,7 @@ + @@ -86,6 +87,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml index a8ecff962b..97bb2cf97f 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_window__dfp_0.xml @@ -41,6 +41,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml index 0cedbbee96..f2f1132769 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_metric_offset_with_granularity__dfp_0.xml @@ -41,6 +41,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml index a2ee6ee189..17be7c1387 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_derived_offset_cumulative_metric__dfp_0.xml @@ -41,6 +41,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml index 6c68f6700e..8b12c3de7b 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_limit_rows_plan__dfp_0.xml @@ -33,6 +33,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml index 9a2f8e0984..ba549be3d2 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml @@ -53,6 +53,7 @@ + @@ -86,6 +87,7 @@ + @@ -113,6 +115,7 @@ + @@ -191,6 +194,7 @@ + @@ -224,6 +228,7 @@ + @@ -251,6 +256,7 @@ + @@ -319,6 +325,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml index 814ba44eff..749bda11de 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml @@ -53,6 +53,7 @@ + @@ -86,6 +87,7 @@ + @@ -131,6 +133,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml index de477d1c55..dd83dca62a 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multi_semantic_model_ratio_metrics_plan__dfp_0.xml @@ -47,6 +47,7 @@ + @@ -74,6 +75,7 @@ + @@ -145,6 +147,7 @@ + @@ -172,6 +175,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml index 0513c678ae..e29686410d 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml @@ -44,11 +44,13 @@ + + @@ -65,6 +67,7 @@ + @@ -97,6 +100,7 @@ + @@ -117,11 +121,13 @@ + + @@ -143,11 +149,25 @@ + + + + + + + + + + + + + + @@ -168,60 +188,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml index 7db1f469eb..b34126863d 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multiple_metrics_plan__dfp_0.xml @@ -38,6 +38,7 @@ + @@ -85,6 +86,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml index 4e848370c1..ea902f79a7 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_order_by_plan__dfp_0.xml @@ -14,6 +14,7 @@ + @@ -56,6 +57,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml index 3469a47a37..0fc68ed052 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_single_semantic_model_ratio_metrics_plan__dfp_0.xml @@ -47,6 +47,7 @@ + @@ -74,6 +75,7 @@ + @@ -145,6 +147,7 @@ + @@ -172,6 +175,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml index 84cda54d21..c5493a3239 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml @@ -41,6 +41,7 @@ + @@ -61,6 +62,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml index d5d1074893..9ab80bd341 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml @@ -35,6 +35,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml index 2ead8da01d..4f3968902a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml @@ -35,6 +35,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_without_offset__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_without_offset__plan0.xml index 6abd3f4209..5f87539f4f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_without_offset__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/DataflowPlan/test_join_to_time_spine_node_without_offset__plan0.xml @@ -35,6 +35,7 @@ + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql index 1e2968eecd..b320e6bd7b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -239,32 +365,74 @@ FULL OUTER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql index f8fa505210..c647a56b30 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index ec37329539..0715f5e0da 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -51,31 +51,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,32 +167,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -175,21 +259,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -218,11 +330,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -231,11 +357,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -296,21 +436,49 @@ FROM ( , subq_10.ds__month , subq_10.ds__quarter , subq_10.ds__year + , subq_10.ds__extract_year + , subq_10.ds__extract_quarter + , subq_10.ds__extract_month + , subq_10.ds__extract_week + , subq_10.ds__extract_day + , subq_10.ds__extract_dayofweek + , subq_10.ds__extract_dayofyear , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month , subq_10.ds_partitioned__quarter , subq_10.ds_partitioned__year + , subq_10.ds_partitioned__extract_year + , subq_10.ds_partitioned__extract_quarter + , subq_10.ds_partitioned__extract_month + , subq_10.ds_partitioned__extract_week + , subq_10.ds_partitioned__extract_day + , subq_10.ds_partitioned__extract_dayofweek + , subq_10.ds_partitioned__extract_dayofyear , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month , subq_10.view__ds__quarter , subq_10.view__ds__year + , subq_10.view__ds__extract_year + , subq_10.view__ds__extract_quarter + , subq_10.view__ds__extract_month + , subq_10.view__ds__extract_week + , subq_10.view__ds__extract_day + , subq_10.view__ds__extract_dayofweek + , subq_10.view__ds__extract_dayofyear , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month , subq_10.view__ds_partitioned__quarter , subq_10.view__ds_partitioned__year + , subq_10.view__ds_partitioned__extract_year + , subq_10.view__ds_partitioned__extract_quarter + , subq_10.view__ds_partitioned__extract_month + , subq_10.view__ds_partitioned__extract_week + , subq_10.view__ds_partitioned__extract_day + , subq_10.view__ds_partitioned__extract_dayofweek + , subq_10.view__ds_partitioned__extract_dayofyear , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -330,21 +498,49 @@ FROM ( , DATE_TRUNC(views_source_src_10009.ds, month) AS ds__month , DATE_TRUNC(views_source_src_10009.ds, quarter) AS ds__quarter , DATE_TRUNC(views_source_src_10009.ds, year) AS ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(views_source_src_10009.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(views_source_src_10009.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(views_source_src_10009.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(views_source_src_10009.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC(views_source_src_10009.ds, isoweek) AS view__ds__week , DATE_TRUNC(views_source_src_10009.ds, month) AS view__ds__month , DATE_TRUNC(views_source_src_10009.ds, quarter) AS view__ds__quarter , DATE_TRUNC(views_source_src_10009.ds, year) AS view__ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC(views_source_src_10009.ds_partitioned, isoweek) AS view__ds_partitioned__week , DATE_TRUNC(views_source_src_10009.ds_partitioned, month) AS view__ds_partitioned__month , DATE_TRUNC(views_source_src_10009.ds_partitioned, quarter) AS view__ds_partitioned__quarter , DATE_TRUNC(views_source_src_10009.ds_partitioned, year) AS view__ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -367,21 +563,49 @@ FROM ( , subq_13.ds__month , subq_13.ds__quarter , subq_13.ds__year + , subq_13.ds__extract_year + , subq_13.ds__extract_quarter + , subq_13.ds__extract_month + , subq_13.ds__extract_week + , subq_13.ds__extract_day + , subq_13.ds__extract_dayofweek + , subq_13.ds__extract_dayofyear , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month , subq_13.created_at__quarter , subq_13.created_at__year + , subq_13.created_at__extract_year + , subq_13.created_at__extract_quarter + , subq_13.created_at__extract_month + , subq_13.created_at__extract_week + , subq_13.created_at__extract_day + , subq_13.created_at__extract_dayofweek + , subq_13.created_at__extract_dayofyear , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month , subq_13.listing__ds__quarter , subq_13.listing__ds__year + , subq_13.listing__ds__extract_year + , subq_13.listing__ds__extract_quarter + , subq_13.listing__ds__extract_month + , subq_13.listing__ds__extract_week + , subq_13.listing__ds__extract_day + , subq_13.listing__ds__extract_dayofweek + , subq_13.listing__ds__extract_dayofyear , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month , subq_13.listing__created_at__quarter , subq_13.listing__created_at__year + , subq_13.listing__created_at__extract_year + , subq_13.listing__created_at__extract_quarter + , subq_13.listing__created_at__extract_month + , subq_13.listing__created_at__extract_week + , subq_13.listing__created_at__extract_day + , subq_13.listing__created_at__extract_dayofweek + , subq_13.listing__created_at__extract_dayofyear , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -410,11 +634,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -423,11 +661,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index 08bfd58be5..7bf9d04ee5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,32 +47,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -99,11 +141,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -112,11 +168,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql index d6a8efaf58..2064e8d4a5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql index 81a62360fc..b2502ec83f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql @@ -38,32 +38,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql index 933fb9ceb6..932baf10dc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql index 94b6d6bce9..3ed483e9d4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql index 2ff6721ee1..0f802052ea 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql @@ -18,11 +18,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -40,11 +54,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql index 1aea8e979f..1f5785cdff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 1421d2e6bd..6f77ab2cfe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql index b0f1599a3b..b53f5ed26c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql index 2509b4af2a..6c4ce49599 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -170,31 +254,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -244,32 +370,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql index 8aecbdf2d9..56f97cc21c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 209adca784..a501f2c21b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql index 344a6f8a7e..64b240f7de 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 4d7ae69b40..706834fa9c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index fc94b13135..65759f67e7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -235,31 +361,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -295,31 +463,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -369,32 +579,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index b35514eac0..12e3863ba1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -236,31 +362,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -296,31 +464,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -370,32 +580,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql index 69c82a8daa..77bb8bd9ad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter , subq_4.ds__year AS ds__year + , subq_4.ds__extract_year AS ds__extract_year + , subq_4.ds__extract_quarter AS ds__extract_quarter + , subq_4.ds__extract_month AS ds__extract_month + , subq_4.ds__extract_week AS ds__extract_week + , subq_4.ds__extract_day AS ds__extract_day + , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month , subq_4.ds_partitioned__quarter AS ds_partitioned__quarter , subq_4.ds_partitioned__year AS ds_partitioned__year + , subq_4.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month , subq_4.paid_at__quarter AS paid_at__quarter , subq_4.paid_at__year AS paid_at__year + , subq_4.paid_at__extract_year AS paid_at__extract_year + , subq_4.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_4.paid_at__extract_month AS paid_at__extract_month + , subq_4.paid_at__extract_week AS paid_at__extract_week + , subq_4.paid_at__extract_day AS paid_at__extract_day + , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month , subq_4.booking__ds__quarter AS booking__ds__quarter , subq_4.booking__ds__year AS booking__ds__year + , subq_4.booking__ds__extract_year AS booking__ds__extract_year + , subq_4.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_4.booking__ds__extract_month AS booking__ds__extract_month + , subq_4.booking__ds__extract_week AS booking__ds__extract_week + , subq_4.booking__ds__extract_day AS booking__ds__extract_day + , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_4.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_4.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_4.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_4.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month , subq_4.booking__paid_at__quarter AS booking__paid_at__quarter , subq_4.booking__paid_at__year AS booking__paid_at__year + , subq_4.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_4.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -88,31 +130,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -152,31 +236,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -226,32 +352,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql index 0611cb68f9..7636cc1e70 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -87,31 +129,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -161,32 +245,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql index c425f193ff..58dc1a7753 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql @@ -42,31 +42,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,32 +158,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -166,21 +250,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -209,11 +321,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -222,11 +348,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql index 54339676f9..275f765347 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql @@ -25,32 +25,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql index 8bf2f905ba..4f0cd51ead 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql index 84967d17b8..eac727a04f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -48,31 +48,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,32 +164,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -172,21 +256,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -215,11 +327,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -228,11 +354,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql index 3e4b26294d..d35cde616a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql @@ -31,7 +31,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__day AS listing__window_end__day + , subq_4.window_end__extract_week AS listing__window_end__extract_week , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -50,31 +50,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -110,32 +152,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10015.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10015.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -153,7 +237,7 @@ FROM ( -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT subq_3.window_start__day - , subq_3.window_end__day + , subq_3.window_end__extract_week , subq_3.listing , subq_3.capacity FROM ( @@ -164,11 +248,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -177,11 +275,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS listing__window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS listing__window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS listing__window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS listing__window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS listing__window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -199,9 +311,9 @@ FROM ( subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__day + subq_2.metric_time__day < subq_4.window_end__extract_week ) OR ( - subq_4.window_end__day IS NULL + subq_4.window_end__extract_week IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql index 86a2010b35..f0af95c23f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql @@ -35,9 +35,9 @@ FROM ( subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < EXTRACT(WEEK FROM listings_src_10017.active_to) ) OR ( - listings_src_10017.active_to IS NULL + EXTRACT(WEEK FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 596f7bc63d..c5d9e328b3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql index 57d8f2dd86..31b984a461 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql index 4bfa0a7160..e346d4997e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql index 76460a6549..e02fa3f09c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql @@ -26,31 +26,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql index 62281ada3f..ee95464b60 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql @@ -21,21 +21,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month , subq_0.created_at__quarter , subq_0.created_at__year + , subq_0.created_at__extract_year + , subq_0.created_at__extract_quarter + , subq_0.created_at__extract_month + , subq_0.created_at__extract_week + , subq_0.created_at__extract_day + , subq_0.created_at__extract_dayofweek + , subq_0.created_at__extract_dayofyear , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month , subq_0.listing__ds__quarter , subq_0.listing__ds__year + , subq_0.listing__ds__extract_year + , subq_0.listing__ds__extract_quarter + , subq_0.listing__ds__extract_month + , subq_0.listing__ds__extract_week + , subq_0.listing__ds__extract_day + , subq_0.listing__ds__extract_dayofweek + , subq_0.listing__ds__extract_dayofyear , subq_0.listing__created_at__day , 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.listing__created_at__extract_year + , subq_0.listing__created_at__extract_quarter + , subq_0.listing__created_at__extract_month + , subq_0.listing__created_at__extract_week + , subq_0.listing__created_at__extract_day + , subq_0.listing__created_at__extract_dayofweek + , subq_0.listing__created_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -77,11 +119,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql index 6b1d66f727..db653ee51c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql @@ -35,32 +35,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql index 32e4f04bb3..6385db4297 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql @@ -60,31 +60,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -134,32 +176,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -184,21 +268,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -227,11 +339,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -240,11 +366,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -317,31 +457,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -391,32 +573,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -441,21 +665,49 @@ FROM ( , subq_15.ds__month , subq_15.ds__quarter , subq_15.ds__year + , subq_15.ds__extract_year + , subq_15.ds__extract_quarter + , subq_15.ds__extract_month + , subq_15.ds__extract_week + , subq_15.ds__extract_day + , subq_15.ds__extract_dayofweek + , subq_15.ds__extract_dayofyear , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month , subq_15.created_at__quarter , subq_15.created_at__year + , subq_15.created_at__extract_year + , subq_15.created_at__extract_quarter + , subq_15.created_at__extract_month + , subq_15.created_at__extract_week + , subq_15.created_at__extract_day + , subq_15.created_at__extract_dayofweek + , subq_15.created_at__extract_dayofyear , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month , subq_15.listing__ds__quarter , subq_15.listing__ds__year + , subq_15.listing__ds__extract_year + , subq_15.listing__ds__extract_quarter + , subq_15.listing__ds__extract_month + , subq_15.listing__ds__extract_week + , subq_15.listing__ds__extract_day + , subq_15.listing__ds__extract_dayofweek + , subq_15.listing__ds__extract_dayofyear , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month , subq_15.listing__created_at__quarter , subq_15.listing__created_at__year + , subq_15.listing__created_at__extract_year + , subq_15.listing__created_at__extract_quarter + , subq_15.listing__created_at__extract_month + , subq_15.listing__created_at__extract_week + , subq_15.listing__created_at__extract_day + , subq_15.listing__created_at__extract_dayofweek + , subq_15.listing__created_at__extract_dayofyear , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -484,11 +736,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -497,11 +763,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -557,31 +837,73 @@ FROM ( , subq_24.ds__month , subq_24.ds__quarter , subq_24.ds__year + , subq_24.ds__extract_year + , subq_24.ds__extract_quarter + , subq_24.ds__extract_month + , subq_24.ds__extract_week + , subq_24.ds__extract_day + , subq_24.ds__extract_dayofweek + , subq_24.ds__extract_dayofyear , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month , subq_24.ds_partitioned__quarter , subq_24.ds_partitioned__year + , subq_24.ds_partitioned__extract_year + , subq_24.ds_partitioned__extract_quarter + , subq_24.ds_partitioned__extract_month + , subq_24.ds_partitioned__extract_week + , subq_24.ds_partitioned__extract_day + , subq_24.ds_partitioned__extract_dayofweek + , subq_24.ds_partitioned__extract_dayofyear , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month , subq_24.paid_at__quarter , subq_24.paid_at__year + , subq_24.paid_at__extract_year + , subq_24.paid_at__extract_quarter + , subq_24.paid_at__extract_month + , subq_24.paid_at__extract_week + , subq_24.paid_at__extract_day + , subq_24.paid_at__extract_dayofweek + , subq_24.paid_at__extract_dayofyear , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month , subq_24.booking__ds__quarter , subq_24.booking__ds__year + , subq_24.booking__ds__extract_year + , subq_24.booking__ds__extract_quarter + , subq_24.booking__ds__extract_month + , subq_24.booking__ds__extract_week + , subq_24.booking__ds__extract_day + , subq_24.booking__ds__extract_dayofweek + , subq_24.booking__ds__extract_dayofyear , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month , subq_24.booking__ds_partitioned__quarter , subq_24.booking__ds_partitioned__year + , subq_24.booking__ds_partitioned__extract_year + , subq_24.booking__ds_partitioned__extract_quarter + , subq_24.booking__ds_partitioned__extract_month + , subq_24.booking__ds_partitioned__extract_week + , subq_24.booking__ds_partitioned__extract_day + , subq_24.booking__ds_partitioned__extract_dayofweek + , subq_24.booking__ds_partitioned__extract_dayofyear , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month , subq_24.booking__paid_at__quarter , subq_24.booking__paid_at__year + , subq_24.booking__paid_at__extract_year + , subq_24.booking__paid_at__extract_quarter + , subq_24.booking__paid_at__extract_month + , subq_24.booking__paid_at__extract_week + , subq_24.booking__paid_at__extract_day + , subq_24.booking__paid_at__extract_dayofweek + , subq_24.booking__paid_at__extract_dayofyear , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -631,32 +953,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql index 0574ca1f09..9352ceb3e2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql @@ -45,31 +45,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,32 +161,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -186,31 +270,73 @@ FROM ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month , subq_7.ds_partitioned__quarter , subq_7.ds_partitioned__year + , subq_7.ds_partitioned__extract_year + , subq_7.ds_partitioned__extract_quarter + , subq_7.ds_partitioned__extract_month + , subq_7.ds_partitioned__extract_week + , subq_7.ds_partitioned__extract_day + , subq_7.ds_partitioned__extract_dayofweek + , subq_7.ds_partitioned__extract_dayofyear , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month , subq_7.paid_at__quarter , subq_7.paid_at__year + , subq_7.paid_at__extract_year + , subq_7.paid_at__extract_quarter + , subq_7.paid_at__extract_month + , subq_7.paid_at__extract_week + , subq_7.paid_at__extract_day + , subq_7.paid_at__extract_dayofweek + , subq_7.paid_at__extract_dayofyear , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month , subq_7.booking__ds__quarter , subq_7.booking__ds__year + , subq_7.booking__ds__extract_year + , subq_7.booking__ds__extract_quarter + , subq_7.booking__ds__extract_month + , subq_7.booking__ds__extract_week + , subq_7.booking__ds__extract_day + , subq_7.booking__ds__extract_dayofweek + , subq_7.booking__ds__extract_dayofyear , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month , subq_7.booking__ds_partitioned__quarter , subq_7.booking__ds_partitioned__year + , subq_7.booking__ds_partitioned__extract_year + , subq_7.booking__ds_partitioned__extract_quarter + , subq_7.booking__ds_partitioned__extract_month + , subq_7.booking__ds_partitioned__extract_week + , subq_7.booking__ds_partitioned__extract_day + , subq_7.booking__ds_partitioned__extract_dayofweek + , subq_7.booking__ds_partitioned__extract_dayofyear , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month , subq_7.booking__paid_at__quarter , subq_7.booking__paid_at__year + , subq_7.booking__paid_at__extract_year + , subq_7.booking__paid_at__extract_quarter + , subq_7.booking__paid_at__extract_month + , subq_7.booking__paid_at__extract_week + , subq_7.booking__paid_at__extract_day + , subq_7.booking__paid_at__extract_dayofweek + , subq_7.booking__paid_at__extract_dayofyear , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -260,32 +386,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql index b05ffb6c76..f40149ee65 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -39,31 +39,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -113,32 +155,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 906d227e1d..8c59fd497e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -160,21 +244,49 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month , subq_5.created_at__quarter , subq_5.created_at__year + , subq_5.created_at__extract_year + , subq_5.created_at__extract_quarter + , subq_5.created_at__extract_month + , subq_5.created_at__extract_week + , subq_5.created_at__extract_day + , subq_5.created_at__extract_dayofweek + , subq_5.created_at__extract_dayofyear , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month , subq_5.listing__ds__quarter , subq_5.listing__ds__year + , subq_5.listing__ds__extract_year + , subq_5.listing__ds__extract_quarter + , subq_5.listing__ds__extract_month + , subq_5.listing__ds__extract_week + , subq_5.listing__ds__extract_day + , subq_5.listing__ds__extract_dayofweek + , subq_5.listing__ds__extract_dayofyear , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month , subq_5.listing__created_at__quarter , subq_5.listing__created_at__year + , subq_5.listing__created_at__extract_year + , subq_5.listing__created_at__extract_quarter + , subq_5.listing__created_at__extract_month + , subq_5.listing__created_at__extract_week + , subq_5.listing__created_at__extract_day + , subq_5.listing__created_at__extract_dayofweek + , subq_5.listing__created_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -203,11 +315,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -216,11 +342,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql index d39a0a23d5..49ab8afb27 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql @@ -21,7 +21,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_7.window_start__day AS listing__window_start__day - , subq_7.window_end__day AS listing__window_end__day + , subq_7.window_end__extract_week AS listing__window_end__extract_week , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10015.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10015.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -143,7 +227,7 @@ FROM ( -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT subq_6.window_start__day - , subq_6.window_end__day + , subq_6.window_end__extract_week , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -154,26 +238,61 @@ FROM ( , subq_3.window_start__month AS window_start__month , subq_3.window_start__quarter AS window_start__quarter , subq_3.window_start__year AS window_start__year + , subq_3.window_start__extract_year AS window_start__extract_year + , subq_3.window_start__extract_quarter AS window_start__extract_quarter + , subq_3.window_start__extract_month AS window_start__extract_month + , subq_3.window_start__extract_week AS window_start__extract_week + , subq_3.window_start__extract_day AS window_start__extract_day + , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek + , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month , subq_3.window_end__quarter AS window_end__quarter , subq_3.window_end__year AS window_end__year + , subq_3.window_end__extract_year AS window_end__extract_year + , subq_3.window_end__extract_quarter AS window_end__extract_quarter + , subq_3.window_end__extract_month AS window_end__extract_month + , subq_3.window_end__extract_week AS window_end__extract_week + , subq_3.window_end__extract_day AS window_end__extract_day + , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek + , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month , subq_3.listing__window_start__quarter AS listing__window_start__quarter , subq_3.listing__window_start__year AS listing__window_start__year + , subq_3.listing__window_start__extract_year AS listing__window_start__extract_year + , subq_3.listing__window_start__extract_quarter AS listing__window_start__extract_quarter + , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month + , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week + , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day + , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek + , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month , subq_3.listing__window_end__quarter AS listing__window_end__quarter , subq_3.listing__window_end__year AS listing__window_end__year + , subq_3.listing__window_end__extract_year AS listing__window_end__extract_year + , subq_3.listing__window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month + , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week + , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day + , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month , subq_5.ds__quarter AS user__ds__quarter , subq_5.ds__year AS user__ds__year + , subq_5.ds__extract_year AS user__ds__extract_year + , subq_5.ds__extract_quarter AS user__ds__extract_quarter + , subq_5.ds__extract_month AS user__ds__extract_month + , subq_5.ds__extract_week AS user__ds__extract_week + , subq_5.ds__extract_day AS user__ds__extract_day + , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek + , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -192,11 +311,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -205,11 +338,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS listing__window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS listing__window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS listing__window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS listing__window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS listing__window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -227,11 +374,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', -- 'user'] SELECT subq_4.ds__day @@ -239,11 +400,25 @@ FROM ( , subq_4.ds__month , subq_4.ds__quarter , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_week + , subq_4.ds__extract_day + , subq_4.ds__extract_dayofweek + , subq_4.ds__extract_dayofyear , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month , subq_4.user__ds__quarter , subq_4.user__ds__year + , subq_4.user__ds__extract_year + , subq_4.user__ds__extract_quarter + , subq_4.user__ds__extract_month + , subq_4.user__ds__extract_week + , subq_4.user__ds__extract_day + , subq_4.user__ds__extract_dayofweek + , subq_4.user__ds__extract_dayofyear , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -255,12 +430,26 @@ FROM ( , DATE_TRUNC(users_latest_src_10021.ds, month) AS ds__month , DATE_TRUNC(users_latest_src_10021.ds, quarter) AS ds__quarter , DATE_TRUNC(users_latest_src_10021.ds, year) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC(users_latest_src_10021.ds, isoweek) AS user__ds__week , DATE_TRUNC(users_latest_src_10021.ds, month) AS user__ds__month , DATE_TRUNC(users_latest_src_10021.ds, quarter) AS user__ds__quarter , DATE_TRUNC(users_latest_src_10021.ds, year) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 @@ -278,9 +467,9 @@ FROM ( subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__day + subq_2.metric_time__day < subq_7.window_end__extract_week ) OR ( - subq_7.window_end__day IS NULL + subq_7.window_end__extract_week IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql index e8abbb3f87..dfbf523e63 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -24,7 +24,7 @@ LEFT OUTER JOIN ( -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -41,9 +41,9 @@ ON subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__day + subq_13.metric_time__day < subq_18.window_end__extract_week ) OR ( - subq_18.window_end__day IS NULL + subq_18.window_end__extract_week IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql index 810e69a1cf..9114deef3f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql @@ -21,7 +21,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day + , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10015.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10015.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -146,7 +230,7 @@ FROM ( -- 'listing'] SELECT subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__day + , subq_6.lux_listing__window_end__extract_month , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -157,11 +241,25 @@ FROM ( , subq_5.window_start__month AS lux_listing__window_start__month , subq_5.window_start__quarter AS lux_listing__window_start__quarter , subq_5.window_start__year AS lux_listing__window_start__year + , subq_5.window_start__extract_year AS lux_listing__window_start__extract_year + , subq_5.window_start__extract_quarter AS lux_listing__window_start__extract_quarter + , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month + , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week + , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day + , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek + , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month , subq_5.window_end__quarter AS lux_listing__window_end__quarter , subq_5.window_end__year AS lux_listing__window_end__year + , subq_5.window_end__extract_year AS lux_listing__window_end__extract_year + , subq_5.window_end__extract_quarter AS lux_listing__window_end__extract_quarter + , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month + , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week + , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day + , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek + , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -183,21 +281,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -205,21 +331,49 @@ FROM ( , subq_4.window_start__month , subq_4.window_start__quarter , subq_4.window_start__year + , subq_4.window_start__extract_year + , subq_4.window_start__extract_quarter + , subq_4.window_start__extract_month + , subq_4.window_start__extract_week + , subq_4.window_start__extract_day + , subq_4.window_start__extract_dayofweek + , subq_4.window_start__extract_dayofyear , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month , subq_4.window_end__quarter , subq_4.window_end__year + , subq_4.window_end__extract_year + , subq_4.window_end__extract_quarter + , subq_4.window_end__extract_month + , subq_4.window_end__extract_week + , subq_4.window_end__extract_day + , subq_4.window_end__extract_dayofweek + , subq_4.window_end__extract_dayofyear , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month , subq_4.lux_listing__window_start__quarter , subq_4.lux_listing__window_start__year + , subq_4.lux_listing__window_start__extract_year + , subq_4.lux_listing__window_start__extract_quarter + , subq_4.lux_listing__window_start__extract_month + , subq_4.lux_listing__window_start__extract_week + , subq_4.lux_listing__window_start__extract_day + , subq_4.lux_listing__window_start__extract_dayofweek + , subq_4.lux_listing__window_start__extract_dayofyear , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month , subq_4.lux_listing__window_end__quarter , subq_4.lux_listing__window_end__year + , subq_4.lux_listing__window_end__extract_year + , subq_4.lux_listing__window_end__extract_quarter + , subq_4.lux_listing__window_end__extract_month + , subq_4.lux_listing__window_end__extract_week + , subq_4.lux_listing__window_end__extract_day + , subq_4.lux_listing__window_end__extract_dayofweek + , subq_4.lux_listing__window_end__extract_dayofyear , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -231,22 +385,50 @@ FROM ( , DATE_TRUNC(lux_listings_src_10019.valid_from, month) AS window_start__month , DATE_TRUNC(lux_listings_src_10019.valid_from, quarter) AS window_start__quarter , DATE_TRUNC(lux_listings_src_10019.valid_from, year) AS window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC(lux_listings_src_10019.valid_to, isoweek) AS window_end__week , DATE_TRUNC(lux_listings_src_10019.valid_to, month) AS window_end__month , DATE_TRUNC(lux_listings_src_10019.valid_to, quarter) AS window_end__quarter , DATE_TRUNC(lux_listings_src_10019.valid_to, year) AS window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC(lux_listings_src_10019.valid_from, isoweek) AS lux_listing__window_start__week , DATE_TRUNC(lux_listings_src_10019.valid_from, month) AS lux_listing__window_start__month , DATE_TRUNC(lux_listings_src_10019.valid_from, quarter) AS lux_listing__window_start__quarter , DATE_TRUNC(lux_listings_src_10019.valid_from, year) AS lux_listing__window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC(lux_listings_src_10019.valid_to, isoweek) AS lux_listing__window_end__week , DATE_TRUNC(lux_listings_src_10019.valid_to, month) AS lux_listing__window_end__month , DATE_TRUNC(lux_listings_src_10019.valid_to, quarter) AS lux_listing__window_end__quarter , DATE_TRUNC(lux_listings_src_10019.valid_to, year) AS lux_listing__window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 @@ -264,9 +446,9 @@ FROM ( subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__day + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month ) OR ( - subq_7.lux_listing__window_end__day IS NULL + subq_7.lux_listing__window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql index 415ccb8d00..33a9a609fa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -27,7 +27,7 @@ LEFT OUTER JOIN ( -- 'listing'] SELECT lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -44,9 +44,9 @@ ON subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__day + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month ) OR ( - subq_18.lux_listing__window_end__day IS NULL + subq_18.lux_listing__window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql index 03d53212bd..9c13f10eec 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql @@ -33,32 +33,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -85,11 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -98,11 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -131,11 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -144,11 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql index 96381bbd71..28e5abd86f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.account_id__ds_partitioned__day , 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_partitioned__extract_year + , subq_0.account_id__ds_partitioned__extract_quarter + , subq_0.account_id__ds_partitioned__extract_month + , subq_0.account_id__ds_partitioned__extract_week + , subq_0.account_id__ds_partitioned__extract_day + , subq_0.account_id__ds_partitioned__extract_dayofweek + , subq_0.account_id__ds_partitioned__extract_dayofyear , subq_0.account_id__ds__day , 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.account_id__ds__extract_year + , subq_0.account_id__ds__extract_quarter + , subq_0.account_id__ds__extract_month + , subq_0.account_id__ds__extract_week + , subq_0.account_id__ds__extract_day + , subq_0.account_id__ds__extract_dayofweek + , subq_0.account_id__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -69,22 +97,50 @@ FROM ( , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC(account_month_txns_src_10010.ds, isoweek) AS ds__week , DATE_TRUNC(account_month_txns_src_10010.ds, month) AS ds__month , DATE_TRUNC(account_month_txns_src_10010.ds, quarter) AS ds__quarter , DATE_TRUNC(account_month_txns_src_10010.ds, year) AS ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, isoweek) AS account_id__ds_partitioned__week , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, month) AS account_id__ds_partitioned__month , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, quarter) AS account_id__ds_partitioned__quarter , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, year) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC(account_month_txns_src_10010.ds, isoweek) AS account_id__ds__week , DATE_TRUNC(account_month_txns_src_10010.ds, month) AS account_id__ds__month , DATE_TRUNC(account_month_txns_src_10010.ds, quarter) AS account_id__ds__quarter , DATE_TRUNC(account_month_txns_src_10010.ds, year) AS account_id__ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -106,16 +162,37 @@ FROM ( , 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.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_3.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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_3.account_id__ds_partitioned__extract_year AS account_id__ds_partitioned__extract_year + , subq_3.account_id__ds_partitioned__extract_quarter AS account_id__ds_partitioned__extract_quarter + , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month + , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week + , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day + , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek + , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , 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_5.ds_partitioned__extract_year AS customer_id__ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter AS customer_id__ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear , 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 @@ -132,12 +209,26 @@ FROM ( , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, isoweek) AS account_id__ds_partitioned__week , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, month) AS account_id__ds_partitioned__month , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, quarter) AS account_id__ds_partitioned__quarter , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, year) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -154,11 +245,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -166,11 +271,25 @@ FROM ( , subq_4.ds_partitioned__month , subq_4.ds_partitioned__quarter , subq_4.ds_partitioned__year + , subq_4.ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear , subq_4.customer_id__ds_partitioned__day , 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__ds_partitioned__extract_year + , subq_4.customer_id__ds_partitioned__extract_quarter + , subq_4.customer_id__ds_partitioned__extract_month + , subq_4.customer_id__ds_partitioned__extract_week + , subq_4.customer_id__ds_partitioned__extract_day + , subq_4.customer_id__ds_partitioned__extract_dayofweek + , subq_4.customer_id__ds_partitioned__extract_dayofyear , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -186,6 +305,13 @@ FROM ( , DATE_TRUNC(customer_table_src_10013.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(customer_table_src_10013.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(customer_table_src_10013.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -193,6 +319,13 @@ FROM ( , DATE_TRUNC(customer_table_src_10013.ds_partitioned, month) AS customer_id__ds_partitioned__month , DATE_TRUNC(customer_table_src_10013.ds_partitioned, quarter) AS customer_id__ds_partitioned__quarter , DATE_TRUNC(customer_table_src_10013.ds_partitioned, year) AS customer_id__ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql index 123b3e721a..696514d415 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql @@ -23,31 +23,73 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month , subq_1.ds_partitioned__quarter , subq_1.ds_partitioned__year + , subq_1.ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month , subq_1.paid_at__quarter , subq_1.paid_at__year + , subq_1.paid_at__extract_year + , subq_1.paid_at__extract_quarter + , subq_1.paid_at__extract_month + , subq_1.paid_at__extract_week + , subq_1.paid_at__extract_day + , subq_1.paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month , subq_1.booking__ds__quarter , subq_1.booking__ds__year + , subq_1.booking__ds__extract_year + , subq_1.booking__ds__extract_quarter + , subq_1.booking__ds__extract_month + , subq_1.booking__ds__extract_week + , subq_1.booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month , subq_1.booking__paid_at__quarter , subq_1.booking__paid_at__year + , subq_1.booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -82,31 +124,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -156,32 +240,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -217,21 +343,49 @@ CROSS JOIN ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month , subq_7.created_at__quarter , subq_7.created_at__year + , subq_7.created_at__extract_year + , subq_7.created_at__extract_quarter + , subq_7.created_at__extract_month + , subq_7.created_at__extract_week + , subq_7.created_at__extract_day + , subq_7.created_at__extract_dayofweek + , subq_7.created_at__extract_dayofyear , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month , subq_7.listing__ds__quarter , subq_7.listing__ds__year + , subq_7.listing__ds__extract_year + , subq_7.listing__ds__extract_quarter + , subq_7.listing__ds__extract_month + , subq_7.listing__ds__extract_week + , subq_7.listing__ds__extract_day + , subq_7.listing__ds__extract_dayofweek + , subq_7.listing__ds__extract_dayofyear , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month , subq_7.listing__created_at__quarter , subq_7.listing__created_at__year + , subq_7.listing__created_at__extract_year + , subq_7.listing__created_at__extract_quarter + , subq_7.listing__created_at__extract_month + , subq_7.listing__created_at__extract_week + , subq_7.listing__created_at__extract_day + , subq_7.listing__created_at__extract_dayofweek + , subq_7.listing__created_at__extract_dayofyear , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -257,21 +411,49 @@ CROSS JOIN ( , subq_6.ds__month , subq_6.ds__quarter , subq_6.ds__year + , subq_6.ds__extract_year + , subq_6.ds__extract_quarter + , subq_6.ds__extract_month + , subq_6.ds__extract_week + , subq_6.ds__extract_day + , subq_6.ds__extract_dayofweek + , subq_6.ds__extract_dayofyear , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month , subq_6.created_at__quarter , subq_6.created_at__year + , subq_6.created_at__extract_year + , subq_6.created_at__extract_quarter + , subq_6.created_at__extract_month + , subq_6.created_at__extract_week + , subq_6.created_at__extract_day + , subq_6.created_at__extract_dayofweek + , subq_6.created_at__extract_dayofyear , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month , subq_6.listing__ds__quarter , subq_6.listing__ds__year + , subq_6.listing__ds__extract_year + , subq_6.listing__ds__extract_quarter + , subq_6.listing__ds__extract_month + , subq_6.listing__ds__extract_week + , subq_6.listing__ds__extract_day + , subq_6.listing__ds__extract_dayofweek + , subq_6.listing__ds__extract_dayofyear , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month , subq_6.listing__created_at__quarter , subq_6.listing__created_at__year + , subq_6.listing__created_at__extract_year + , subq_6.listing__created_at__extract_quarter + , subq_6.listing__created_at__extract_month + , subq_6.listing__created_at__extract_week + , subq_6.listing__created_at__extract_day + , subq_6.listing__created_at__extract_dayofweek + , subq_6.listing__created_at__extract_dayofyear , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -300,11 +482,25 @@ CROSS JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -313,11 +509,25 @@ CROSS JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql index 3ade4193b3..79e108f49f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql @@ -44,31 +44,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -118,32 +160,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -182,31 +266,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -256,32 +382,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,31 +500,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -406,32 +616,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -480,31 +732,73 @@ FROM ( , subq_17.ds__month , subq_17.ds__quarter , subq_17.ds__year + , subq_17.ds__extract_year + , subq_17.ds__extract_quarter + , subq_17.ds__extract_month + , subq_17.ds__extract_week + , subq_17.ds__extract_day + , subq_17.ds__extract_dayofweek + , subq_17.ds__extract_dayofyear , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month , subq_17.ds_partitioned__quarter , subq_17.ds_partitioned__year + , subq_17.ds_partitioned__extract_year + , subq_17.ds_partitioned__extract_quarter + , subq_17.ds_partitioned__extract_month + , subq_17.ds_partitioned__extract_week + , subq_17.ds_partitioned__extract_day + , subq_17.ds_partitioned__extract_dayofweek + , subq_17.ds_partitioned__extract_dayofyear , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month , subq_17.paid_at__quarter , subq_17.paid_at__year + , subq_17.paid_at__extract_year + , subq_17.paid_at__extract_quarter + , subq_17.paid_at__extract_month + , subq_17.paid_at__extract_week + , subq_17.paid_at__extract_day + , subq_17.paid_at__extract_dayofweek + , subq_17.paid_at__extract_dayofyear , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month , subq_17.booking__ds__quarter , subq_17.booking__ds__year + , subq_17.booking__ds__extract_year + , subq_17.booking__ds__extract_quarter + , subq_17.booking__ds__extract_month + , subq_17.booking__ds__extract_week + , subq_17.booking__ds__extract_day + , subq_17.booking__ds__extract_dayofweek + , subq_17.booking__ds__extract_dayofyear , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month , subq_17.booking__ds_partitioned__quarter , subq_17.booking__ds_partitioned__year + , subq_17.booking__ds_partitioned__extract_year + , subq_17.booking__ds_partitioned__extract_quarter + , subq_17.booking__ds_partitioned__extract_month + , subq_17.booking__ds_partitioned__extract_week + , subq_17.booking__ds_partitioned__extract_day + , subq_17.booking__ds_partitioned__extract_dayofweek + , subq_17.booking__ds_partitioned__extract_dayofyear , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month , subq_17.booking__paid_at__quarter , subq_17.booking__paid_at__year + , subq_17.booking__paid_at__extract_year + , subq_17.booking__paid_at__extract_quarter + , subq_17.booking__paid_at__extract_month + , subq_17.booking__paid_at__extract_week + , subq_17.booking__paid_at__extract_day + , subq_17.booking__paid_at__extract_dayofweek + , subq_17.booking__paid_at__extract_dayofyear , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -554,32 +848,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql index 508c33253e..6fe53f5780 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql @@ -45,32 +45,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql index c27cc36a57..e04b6506be 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month , subq_0.verification__ds__quarter , subq_0.verification__ds__year + , subq_0.verification__ds__extract_year + , subq_0.verification__ds__extract_quarter + , subq_0.verification__ds__extract_month + , subq_0.verification__ds__extract_week + , subq_0.verification__ds__extract_day + , subq_0.verification__ds__extract_dayofweek + , subq_0.verification__ds__extract_dayofyear , subq_0.verification__ds_partitioned__day , 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.verification__ds_partitioned__extract_year + , subq_0.verification__ds_partitioned__extract_quarter + , subq_0.verification__ds_partitioned__extract_month + , subq_0.verification__ds_partitioned__extract_week + , subq_0.verification__ds_partitioned__extract_day + , subq_0.verification__ds_partitioned__extract_dayofweek + , subq_0.verification__ds_partitioned__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -71,22 +99,50 @@ FROM ( , DATE_TRUNC(id_verifications_src_10003.ds, month) AS ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week , DATE_TRUNC(id_verifications_src_10003.ds, month) AS verification__ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS verification__ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS verification__ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -110,32 +166,74 @@ FROM ( , DATE_TRUNC(users_ds_source_src_10007.ds, month) AS ds__month , DATE_TRUNC(users_ds_source_src_10007.ds, quarter) AS ds__quarter , DATE_TRUNC(users_ds_source_src_10007.ds, year) AS ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC(users_ds_source_src_10007.created_at, isoweek) AS created_at__week , DATE_TRUNC(users_ds_source_src_10007.created_at, month) AS created_at__month , DATE_TRUNC(users_ds_source_src_10007.created_at, quarter) AS created_at__quarter , DATE_TRUNC(users_ds_source_src_10007.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC(users_ds_source_src_10007.ds, isoweek) AS user__ds__week , DATE_TRUNC(users_ds_source_src_10007.ds, month) AS user__ds__month , DATE_TRUNC(users_ds_source_src_10007.ds, quarter) AS user__ds__quarter , DATE_TRUNC(users_ds_source_src_10007.ds, year) AS user__ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC(users_ds_source_src_10007.created_at, isoweek) AS user__created_at__week , DATE_TRUNC(users_ds_source_src_10007.created_at, month) AS user__created_at__month , DATE_TRUNC(users_ds_source_src_10007.created_at, quarter) AS user__created_at__quarter , DATE_TRUNC(users_ds_source_src_10007.created_at, year) AS user__created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, isoweek) AS user__ds_partitioned__week , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, month) AS user__ds_partitioned__month , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, quarter) AS user__ds_partitioned__quarter , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, year) AS user__ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql index 019d4f0431..febccc91aa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -54,12 +82,26 @@ INNER JOIN ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql index d8a55e4ce8..17d01a31fc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week , DATE_TRUNC(ds, month) AS account__ds__month , DATE_TRUNC(ds, quarter) AS account__ds__quarter , DATE_TRUNC(ds, year) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql index be0601ac7d..cc5ef6ef07 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index c01273992a..8fbb61349d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week , DATE_TRUNC(ds, month) AS account__ds__month , DATE_TRUNC(ds, quarter) AS account__ds__quarter , DATE_TRUNC(ds, year) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 4e696ff946..ab91ef4285 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index 15961c6c39..c1a7811068 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week , DATE_TRUNC(ds, month) AS account__ds__month , DATE_TRUNC(ds, quarter) AS account__ds__quarter , DATE_TRUNC(ds, year) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql index 5f0ad187f7..2f7370d5ba 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -83,11 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -96,11 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql index 1f8a069b02..2f0a3bb53b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql index 39876db194..d68f494296 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month , DATE_TRUNC(paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month , DATE_TRUNC(ds, quarter) AS booking__ds__quarter , DATE_TRUNC(ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month , DATE_TRUNC(paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql index 214766cb17..8209ee600a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -239,32 +365,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql index 63637a9433..9ddc5fe579 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 9c4d91d069..e556d194aa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -51,31 +51,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,32 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -175,21 +259,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -218,11 +330,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -231,11 +357,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -296,21 +436,49 @@ FROM ( , subq_10.ds__month , subq_10.ds__quarter , subq_10.ds__year + , subq_10.ds__extract_year + , subq_10.ds__extract_quarter + , subq_10.ds__extract_month + , subq_10.ds__extract_week + , subq_10.ds__extract_day + , subq_10.ds__extract_dayofweek + , subq_10.ds__extract_dayofyear , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month , subq_10.ds_partitioned__quarter , subq_10.ds_partitioned__year + , subq_10.ds_partitioned__extract_year + , subq_10.ds_partitioned__extract_quarter + , subq_10.ds_partitioned__extract_month + , subq_10.ds_partitioned__extract_week + , subq_10.ds_partitioned__extract_day + , subq_10.ds_partitioned__extract_dayofweek + , subq_10.ds_partitioned__extract_dayofyear , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month , subq_10.view__ds__quarter , subq_10.view__ds__year + , subq_10.view__ds__extract_year + , subq_10.view__ds__extract_quarter + , subq_10.view__ds__extract_month + , subq_10.view__ds__extract_week + , subq_10.view__ds__extract_day + , subq_10.view__ds__extract_dayofweek + , subq_10.view__ds__extract_dayofyear , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month , subq_10.view__ds_partitioned__quarter , subq_10.view__ds_partitioned__year + , subq_10.view__ds_partitioned__extract_year + , subq_10.view__ds_partitioned__extract_quarter + , subq_10.view__ds_partitioned__extract_month + , subq_10.view__ds_partitioned__extract_week + , subq_10.view__ds_partitioned__extract_day + , subq_10.view__ds_partitioned__extract_dayofweek + , subq_10.view__ds_partitioned__extract_dayofyear , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -330,21 +498,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM views_source_src_10009.ds) AS ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek + , EXTRACT(DOY FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -367,21 +563,49 @@ FROM ( , subq_13.ds__month , subq_13.ds__quarter , subq_13.ds__year + , subq_13.ds__extract_year + , subq_13.ds__extract_quarter + , subq_13.ds__extract_month + , subq_13.ds__extract_week + , subq_13.ds__extract_day + , subq_13.ds__extract_dayofweek + , subq_13.ds__extract_dayofyear , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month , subq_13.created_at__quarter , subq_13.created_at__year + , subq_13.created_at__extract_year + , subq_13.created_at__extract_quarter + , subq_13.created_at__extract_month + , subq_13.created_at__extract_week + , subq_13.created_at__extract_day + , subq_13.created_at__extract_dayofweek + , subq_13.created_at__extract_dayofyear , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month , subq_13.listing__ds__quarter , subq_13.listing__ds__year + , subq_13.listing__ds__extract_year + , subq_13.listing__ds__extract_quarter + , subq_13.listing__ds__extract_month + , subq_13.listing__ds__extract_week + , subq_13.listing__ds__extract_day + , subq_13.listing__ds__extract_dayofweek + , subq_13.listing__ds__extract_dayofyear , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month , subq_13.listing__created_at__quarter , subq_13.listing__created_at__year + , subq_13.listing__created_at__extract_year + , subq_13.listing__created_at__extract_quarter + , subq_13.listing__created_at__extract_month + , subq_13.listing__created_at__extract_week + , subq_13.listing__created_at__extract_day + , subq_13.listing__created_at__extract_dayofweek + , subq_13.listing__created_at__extract_dayofyear , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -410,11 +634,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -423,11 +661,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index dd55a54b61..f47fd76de7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,32 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -99,11 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -112,11 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql index 48583b238a..3eb622fa49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql index 4ca35f2544..2b0077fe9a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql @@ -38,32 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql index b515ad2da5..7a21860fcb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql index 5eb893b84a..98ba846b40 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql index 2393630095..4695227af1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql @@ -18,11 +18,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -40,11 +54,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql index 9ced88e0cc..d7d79e0e55 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index dd00d2b15e..ea1c3531d4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql index 658dcf3357..553a0f19f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql index 9bafb5e1f6..50f09e5c00 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -170,31 +254,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -244,32 +370,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql index edbbe545fd..82c9f10475 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index c97b8fd930..9fe9c136c1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql index 03b1c29282..daa52ca41e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 6a32edb464..aa0f8a119a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index d52164ec94..ecc7b21c32 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -235,31 +361,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -295,31 +463,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -369,32 +579,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 1a2a3259ba..9ab034b843 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -236,31 +362,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -296,31 +464,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -370,32 +580,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql index edd3eef59c..a3509be579 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter , subq_4.ds__year AS ds__year + , subq_4.ds__extract_year AS ds__extract_year + , subq_4.ds__extract_quarter AS ds__extract_quarter + , subq_4.ds__extract_month AS ds__extract_month + , subq_4.ds__extract_week AS ds__extract_week + , subq_4.ds__extract_day AS ds__extract_day + , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month , subq_4.ds_partitioned__quarter AS ds_partitioned__quarter , subq_4.ds_partitioned__year AS ds_partitioned__year + , subq_4.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month , subq_4.paid_at__quarter AS paid_at__quarter , subq_4.paid_at__year AS paid_at__year + , subq_4.paid_at__extract_year AS paid_at__extract_year + , subq_4.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_4.paid_at__extract_month AS paid_at__extract_month + , subq_4.paid_at__extract_week AS paid_at__extract_week + , subq_4.paid_at__extract_day AS paid_at__extract_day + , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month , subq_4.booking__ds__quarter AS booking__ds__quarter , subq_4.booking__ds__year AS booking__ds__year + , subq_4.booking__ds__extract_year AS booking__ds__extract_year + , subq_4.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_4.booking__ds__extract_month AS booking__ds__extract_month + , subq_4.booking__ds__extract_week AS booking__ds__extract_week + , subq_4.booking__ds__extract_day AS booking__ds__extract_day + , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_4.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_4.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_4.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_4.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month , subq_4.booking__paid_at__quarter AS booking__paid_at__quarter , subq_4.booking__paid_at__year AS booking__paid_at__year + , subq_4.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_4.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -88,31 +130,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -152,31 +236,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -226,32 +352,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql index 26c360ab9e..466af8e156 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -87,31 +129,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -161,32 +245,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql index 870b2c80ea..049dfd23fb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql @@ -42,31 +42,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,32 +158,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -166,21 +250,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -209,11 +321,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -222,11 +348,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql index ddba65921c..ceb7438a40 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql @@ -25,32 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql index 7ce1a71c7f..95f3b7ed5a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql index 81e6d39ada..479ed8d1ef 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -48,31 +48,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,32 +164,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -172,21 +256,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -215,11 +327,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -228,11 +354,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql index 4caa3d07f0..35fca69027 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__day AS listing__window_end__day + , subq_4.window_start__extract_month AS listing__window_start__extract_month + , subq_4.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -50,31 +50,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -110,32 +152,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -152,8 +236,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__day - , subq_3.window_end__day + subq_3.window_start__extract_month + , subq_3.window_end__extract_dayofweek , subq_3.listing , subq_3.capacity FROM ( @@ -164,11 +248,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -177,11 +275,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -196,12 +308,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__day + subq_2.metric_time__day >= subq_4.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__day + subq_2.metric_time__day < subq_4.window_end__extract_dayofweek ) OR ( - subq_4.window_end__day IS NULL + subq_4.window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql index 86a2010b35..710e67b149 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) ) OR ( - listings_src_10017.active_to IS NULL + EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ed1bd4e99..70accec611 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql index 22702f0c48..a6aabb20c2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql index 027f20ea5b..80e8fdda4b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql index 913fed793c..42f33bb96e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql @@ -26,31 +26,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql index 86b30c4553..973abdbb6f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql @@ -21,21 +21,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month , subq_0.created_at__quarter , subq_0.created_at__year + , subq_0.created_at__extract_year + , subq_0.created_at__extract_quarter + , subq_0.created_at__extract_month + , subq_0.created_at__extract_week + , subq_0.created_at__extract_day + , subq_0.created_at__extract_dayofweek + , subq_0.created_at__extract_dayofyear , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month , subq_0.listing__ds__quarter , subq_0.listing__ds__year + , subq_0.listing__ds__extract_year + , subq_0.listing__ds__extract_quarter + , subq_0.listing__ds__extract_month + , subq_0.listing__ds__extract_week + , subq_0.listing__ds__extract_day + , subq_0.listing__ds__extract_dayofweek + , subq_0.listing__ds__extract_dayofyear , subq_0.listing__created_at__day , 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.listing__created_at__extract_year + , subq_0.listing__created_at__extract_quarter + , subq_0.listing__created_at__extract_month + , subq_0.listing__created_at__extract_week + , subq_0.listing__created_at__extract_day + , subq_0.listing__created_at__extract_dayofweek + , subq_0.listing__created_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -77,11 +119,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql index 316737d00a..97140fd5a8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql @@ -35,32 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql index 73e6a70d92..c99d63cffa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql @@ -60,31 +60,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -134,32 +176,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -184,21 +268,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -227,11 +339,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -240,11 +366,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -317,31 +457,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -391,32 +573,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -441,21 +665,49 @@ FROM ( , subq_15.ds__month , subq_15.ds__quarter , subq_15.ds__year + , subq_15.ds__extract_year + , subq_15.ds__extract_quarter + , subq_15.ds__extract_month + , subq_15.ds__extract_week + , subq_15.ds__extract_day + , subq_15.ds__extract_dayofweek + , subq_15.ds__extract_dayofyear , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month , subq_15.created_at__quarter , subq_15.created_at__year + , subq_15.created_at__extract_year + , subq_15.created_at__extract_quarter + , subq_15.created_at__extract_month + , subq_15.created_at__extract_week + , subq_15.created_at__extract_day + , subq_15.created_at__extract_dayofweek + , subq_15.created_at__extract_dayofyear , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month , subq_15.listing__ds__quarter , subq_15.listing__ds__year + , subq_15.listing__ds__extract_year + , subq_15.listing__ds__extract_quarter + , subq_15.listing__ds__extract_month + , subq_15.listing__ds__extract_week + , subq_15.listing__ds__extract_day + , subq_15.listing__ds__extract_dayofweek + , subq_15.listing__ds__extract_dayofyear , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month , subq_15.listing__created_at__quarter , subq_15.listing__created_at__year + , subq_15.listing__created_at__extract_year + , subq_15.listing__created_at__extract_quarter + , subq_15.listing__created_at__extract_month + , subq_15.listing__created_at__extract_week + , subq_15.listing__created_at__extract_day + , subq_15.listing__created_at__extract_dayofweek + , subq_15.listing__created_at__extract_dayofyear , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -484,11 +736,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -497,11 +763,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -557,31 +837,73 @@ FROM ( , subq_24.ds__month , subq_24.ds__quarter , subq_24.ds__year + , subq_24.ds__extract_year + , subq_24.ds__extract_quarter + , subq_24.ds__extract_month + , subq_24.ds__extract_week + , subq_24.ds__extract_day + , subq_24.ds__extract_dayofweek + , subq_24.ds__extract_dayofyear , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month , subq_24.ds_partitioned__quarter , subq_24.ds_partitioned__year + , subq_24.ds_partitioned__extract_year + , subq_24.ds_partitioned__extract_quarter + , subq_24.ds_partitioned__extract_month + , subq_24.ds_partitioned__extract_week + , subq_24.ds_partitioned__extract_day + , subq_24.ds_partitioned__extract_dayofweek + , subq_24.ds_partitioned__extract_dayofyear , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month , subq_24.paid_at__quarter , subq_24.paid_at__year + , subq_24.paid_at__extract_year + , subq_24.paid_at__extract_quarter + , subq_24.paid_at__extract_month + , subq_24.paid_at__extract_week + , subq_24.paid_at__extract_day + , subq_24.paid_at__extract_dayofweek + , subq_24.paid_at__extract_dayofyear , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month , subq_24.booking__ds__quarter , subq_24.booking__ds__year + , subq_24.booking__ds__extract_year + , subq_24.booking__ds__extract_quarter + , subq_24.booking__ds__extract_month + , subq_24.booking__ds__extract_week + , subq_24.booking__ds__extract_day + , subq_24.booking__ds__extract_dayofweek + , subq_24.booking__ds__extract_dayofyear , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month , subq_24.booking__ds_partitioned__quarter , subq_24.booking__ds_partitioned__year + , subq_24.booking__ds_partitioned__extract_year + , subq_24.booking__ds_partitioned__extract_quarter + , subq_24.booking__ds_partitioned__extract_month + , subq_24.booking__ds_partitioned__extract_week + , subq_24.booking__ds_partitioned__extract_day + , subq_24.booking__ds_partitioned__extract_dayofweek + , subq_24.booking__ds_partitioned__extract_dayofyear , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month , subq_24.booking__paid_at__quarter , subq_24.booking__paid_at__year + , subq_24.booking__paid_at__extract_year + , subq_24.booking__paid_at__extract_quarter + , subq_24.booking__paid_at__extract_month + , subq_24.booking__paid_at__extract_week + , subq_24.booking__paid_at__extract_day + , subq_24.booking__paid_at__extract_dayofweek + , subq_24.booking__paid_at__extract_dayofyear , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -631,32 +953,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql index 4176ca90e9..1e3f035827 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql @@ -45,31 +45,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,32 +161,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -186,31 +270,73 @@ FROM ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month , subq_7.ds_partitioned__quarter , subq_7.ds_partitioned__year + , subq_7.ds_partitioned__extract_year + , subq_7.ds_partitioned__extract_quarter + , subq_7.ds_partitioned__extract_month + , subq_7.ds_partitioned__extract_week + , subq_7.ds_partitioned__extract_day + , subq_7.ds_partitioned__extract_dayofweek + , subq_7.ds_partitioned__extract_dayofyear , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month , subq_7.paid_at__quarter , subq_7.paid_at__year + , subq_7.paid_at__extract_year + , subq_7.paid_at__extract_quarter + , subq_7.paid_at__extract_month + , subq_7.paid_at__extract_week + , subq_7.paid_at__extract_day + , subq_7.paid_at__extract_dayofweek + , subq_7.paid_at__extract_dayofyear , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month , subq_7.booking__ds__quarter , subq_7.booking__ds__year + , subq_7.booking__ds__extract_year + , subq_7.booking__ds__extract_quarter + , subq_7.booking__ds__extract_month + , subq_7.booking__ds__extract_week + , subq_7.booking__ds__extract_day + , subq_7.booking__ds__extract_dayofweek + , subq_7.booking__ds__extract_dayofyear , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month , subq_7.booking__ds_partitioned__quarter , subq_7.booking__ds_partitioned__year + , subq_7.booking__ds_partitioned__extract_year + , subq_7.booking__ds_partitioned__extract_quarter + , subq_7.booking__ds_partitioned__extract_month + , subq_7.booking__ds_partitioned__extract_week + , subq_7.booking__ds_partitioned__extract_day + , subq_7.booking__ds_partitioned__extract_dayofweek + , subq_7.booking__ds_partitioned__extract_dayofyear , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month , subq_7.booking__paid_at__quarter , subq_7.booking__paid_at__year + , subq_7.booking__paid_at__extract_year + , subq_7.booking__paid_at__extract_quarter + , subq_7.booking__paid_at__extract_month + , subq_7.booking__paid_at__extract_week + , subq_7.booking__paid_at__extract_day + , subq_7.booking__paid_at__extract_dayofweek + , subq_7.booking__paid_at__extract_dayofyear , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -260,32 +386,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 13d80a91d0..1286214deb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -39,31 +39,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -113,32 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 14ec230f17..0b3cc84657 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -160,21 +244,49 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month , subq_5.created_at__quarter , subq_5.created_at__year + , subq_5.created_at__extract_year + , subq_5.created_at__extract_quarter + , subq_5.created_at__extract_month + , subq_5.created_at__extract_week + , subq_5.created_at__extract_day + , subq_5.created_at__extract_dayofweek + , subq_5.created_at__extract_dayofyear , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month , subq_5.listing__ds__quarter , subq_5.listing__ds__year + , subq_5.listing__ds__extract_year + , subq_5.listing__ds__extract_quarter + , subq_5.listing__ds__extract_month + , subq_5.listing__ds__extract_week + , subq_5.listing__ds__extract_day + , subq_5.listing__ds__extract_dayofweek + , subq_5.listing__ds__extract_dayofyear , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month , subq_5.listing__created_at__quarter , subq_5.listing__created_at__year + , subq_5.listing__created_at__extract_year + , subq_5.listing__created_at__extract_quarter + , subq_5.listing__created_at__extract_month + , subq_5.listing__created_at__extract_week + , subq_5.listing__created_at__extract_day + , subq_5.listing__created_at__extract_dayofweek + , subq_5.listing__created_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -203,11 +315,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -216,11 +342,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql index 88cc0b431d..e0644705db 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__day AS listing__window_start__day - , subq_7.window_end__day AS listing__window_end__day + , subq_7.window_start__extract_month AS listing__window_start__extract_month + , subq_7.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -142,8 +226,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__day - , subq_6.window_end__day + subq_6.window_start__extract_month + , subq_6.window_end__extract_dayofweek , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -154,26 +238,61 @@ FROM ( , subq_3.window_start__month AS window_start__month , subq_3.window_start__quarter AS window_start__quarter , subq_3.window_start__year AS window_start__year + , subq_3.window_start__extract_year AS window_start__extract_year + , subq_3.window_start__extract_quarter AS window_start__extract_quarter + , subq_3.window_start__extract_month AS window_start__extract_month + , subq_3.window_start__extract_week AS window_start__extract_week + , subq_3.window_start__extract_day AS window_start__extract_day + , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek + , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month , subq_3.window_end__quarter AS window_end__quarter , subq_3.window_end__year AS window_end__year + , subq_3.window_end__extract_year AS window_end__extract_year + , subq_3.window_end__extract_quarter AS window_end__extract_quarter + , subq_3.window_end__extract_month AS window_end__extract_month + , subq_3.window_end__extract_week AS window_end__extract_week + , subq_3.window_end__extract_day AS window_end__extract_day + , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek + , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month , subq_3.listing__window_start__quarter AS listing__window_start__quarter , subq_3.listing__window_start__year AS listing__window_start__year + , subq_3.listing__window_start__extract_year AS listing__window_start__extract_year + , subq_3.listing__window_start__extract_quarter AS listing__window_start__extract_quarter + , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month + , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week + , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day + , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek + , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month , subq_3.listing__window_end__quarter AS listing__window_end__quarter , subq_3.listing__window_end__year AS listing__window_end__year + , subq_3.listing__window_end__extract_year AS listing__window_end__extract_year + , subq_3.listing__window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month + , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week + , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day + , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month , subq_5.ds__quarter AS user__ds__quarter , subq_5.ds__year AS user__ds__year + , subq_5.ds__extract_year AS user__ds__extract_year + , subq_5.ds__extract_quarter AS user__ds__extract_quarter + , subq_5.ds__extract_month AS user__ds__extract_month + , subq_5.ds__extract_week AS user__ds__extract_week + , subq_5.ds__extract_day AS user__ds__extract_day + , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek + , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -192,11 +311,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -205,11 +338,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DOY FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -227,11 +374,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', -- 'user'] SELECT subq_4.ds__day @@ -239,11 +400,25 @@ FROM ( , subq_4.ds__month , subq_4.ds__quarter , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_week + , subq_4.ds__extract_day + , subq_4.ds__extract_dayofweek + , subq_4.ds__extract_dayofyear , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month , subq_4.user__ds__quarter , subq_4.user__ds__year + , subq_4.user__ds__extract_year + , subq_4.user__ds__extract_quarter + , subq_4.user__ds__extract_month + , subq_4.user__ds__extract_week + , subq_4.user__ds__extract_day + , subq_4.user__ds__extract_dayofweek + , subq_4.user__ds__extract_dayofyear , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -255,12 +430,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM users_latest_src_10021.ds) AS ds__extract_dayofyear , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek + , EXTRACT(DOY FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 @@ -275,12 +464,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__day + subq_2.metric_time__day >= subq_7.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__day + subq_2.metric_time__day < subq_7.window_end__extract_dayofweek ) OR ( - subq_7.window_end__day IS NULL + subq_7.window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql index feb5ed0fdc..425b62e62c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day + EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__day + subq_13.metric_time__day >= subq_18.window_start__extract_month ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__day + subq_13.metric_time__day < subq_18.window_end__extract_dayofweek ) OR ( - subq_18.window_end__day IS NULL + subq_18.window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql index 94054a124c..20137a0df6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day + , subq_7.lux_listing__window_start__extract_day AS listing__lux_listing__window_start__extract_day + , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -145,8 +229,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__day + subq_6.lux_listing__window_start__extract_day + , subq_6.lux_listing__window_end__extract_month , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -157,11 +241,25 @@ FROM ( , subq_5.window_start__month AS lux_listing__window_start__month , subq_5.window_start__quarter AS lux_listing__window_start__quarter , subq_5.window_start__year AS lux_listing__window_start__year + , subq_5.window_start__extract_year AS lux_listing__window_start__extract_year + , subq_5.window_start__extract_quarter AS lux_listing__window_start__extract_quarter + , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month + , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week + , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day + , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek + , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month , subq_5.window_end__quarter AS lux_listing__window_end__quarter , subq_5.window_end__year AS lux_listing__window_end__year + , subq_5.window_end__extract_year AS lux_listing__window_end__extract_year + , subq_5.window_end__extract_quarter AS lux_listing__window_end__extract_quarter + , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month + , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week + , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day + , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek + , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -183,21 +281,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -205,21 +331,49 @@ FROM ( , subq_4.window_start__month , subq_4.window_start__quarter , subq_4.window_start__year + , subq_4.window_start__extract_year + , subq_4.window_start__extract_quarter + , subq_4.window_start__extract_month + , subq_4.window_start__extract_week + , subq_4.window_start__extract_day + , subq_4.window_start__extract_dayofweek + , subq_4.window_start__extract_dayofyear , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month , subq_4.window_end__quarter , subq_4.window_end__year + , subq_4.window_end__extract_year + , subq_4.window_end__extract_quarter + , subq_4.window_end__extract_month + , subq_4.window_end__extract_week + , subq_4.window_end__extract_day + , subq_4.window_end__extract_dayofweek + , subq_4.window_end__extract_dayofyear , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month , subq_4.lux_listing__window_start__quarter , subq_4.lux_listing__window_start__year + , subq_4.lux_listing__window_start__extract_year + , subq_4.lux_listing__window_start__extract_quarter + , subq_4.lux_listing__window_start__extract_month + , subq_4.lux_listing__window_start__extract_week + , subq_4.lux_listing__window_start__extract_day + , subq_4.lux_listing__window_start__extract_dayofweek + , subq_4.lux_listing__window_start__extract_dayofyear , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month , subq_4.lux_listing__window_end__quarter , subq_4.lux_listing__window_end__year + , subq_4.lux_listing__window_end__extract_year + , subq_4.lux_listing__window_end__extract_quarter + , subq_4.lux_listing__window_end__extract_month + , subq_4.lux_listing__window_end__extract_week + , subq_4.lux_listing__window_end__extract_day + , subq_4.lux_listing__window_end__extract_dayofweek + , subq_4.lux_listing__window_end__extract_dayofyear , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -231,22 +385,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek + , EXTRACT(DOY FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek + , EXTRACT(DOY FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(DOY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + , EXTRACT(DOY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 @@ -261,12 +443,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__day + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month ) OR ( - subq_7.lux_listing__window_end__day IS NULL + subq_7.lux_listing__window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql index f1b419a284..b495cc4b52 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day + EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__day + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month ) OR ( - subq_18.lux_listing__window_end__day IS NULL + subq_18.lux_listing__window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql index ae8b7838b7..027d1adb23 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql @@ -33,32 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -85,11 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -98,11 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -131,11 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -144,11 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql index d35179ebf0..234bd823d2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.account_id__ds_partitioned__day , 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_partitioned__extract_year + , subq_0.account_id__ds_partitioned__extract_quarter + , subq_0.account_id__ds_partitioned__extract_month + , subq_0.account_id__ds_partitioned__extract_week + , subq_0.account_id__ds_partitioned__extract_day + , subq_0.account_id__ds_partitioned__extract_dayofweek + , subq_0.account_id__ds_partitioned__extract_dayofyear , subq_0.account_id__ds__day , 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.account_id__ds__extract_year + , subq_0.account_id__ds__extract_quarter + , subq_0.account_id__ds__extract_month + , subq_0.account_id__ds__extract_week + , subq_0.account_id__ds__extract_day + , subq_0.account_id__ds__extract_dayofweek + , subq_0.account_id__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -69,22 +97,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek + , EXTRACT(DOY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -106,16 +162,37 @@ FROM ( , 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.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_3.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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_3.account_id__ds_partitioned__extract_year AS account_id__ds_partitioned__extract_year + , subq_3.account_id__ds_partitioned__extract_quarter AS account_id__ds_partitioned__extract_quarter + , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month + , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week + , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day + , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek + , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , 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_5.ds_partitioned__extract_year AS customer_id__ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter AS customer_id__ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear , 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 @@ -132,12 +209,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -154,11 +245,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -166,11 +271,25 @@ FROM ( , subq_4.ds_partitioned__month , subq_4.ds_partitioned__quarter , subq_4.ds_partitioned__year + , subq_4.ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear , subq_4.customer_id__ds_partitioned__day , 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__ds_partitioned__extract_year + , subq_4.customer_id__ds_partitioned__extract_quarter + , subq_4.customer_id__ds_partitioned__extract_month + , subq_4.customer_id__ds_partitioned__extract_week + , subq_4.customer_id__ds_partitioned__extract_day + , subq_4.customer_id__ds_partitioned__extract_dayofweek + , subq_4.customer_id__ds_partitioned__extract_dayofyear , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -186,6 +305,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -193,6 +319,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql index 5c9089deaf..1ee70afb0b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql @@ -23,31 +23,73 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month , subq_1.ds_partitioned__quarter , subq_1.ds_partitioned__year + , subq_1.ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month , subq_1.paid_at__quarter , subq_1.paid_at__year + , subq_1.paid_at__extract_year + , subq_1.paid_at__extract_quarter + , subq_1.paid_at__extract_month + , subq_1.paid_at__extract_week + , subq_1.paid_at__extract_day + , subq_1.paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month , subq_1.booking__ds__quarter , subq_1.booking__ds__year + , subq_1.booking__ds__extract_year + , subq_1.booking__ds__extract_quarter + , subq_1.booking__ds__extract_month + , subq_1.booking__ds__extract_week + , subq_1.booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month , subq_1.booking__paid_at__quarter , subq_1.booking__paid_at__year + , subq_1.booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -82,31 +124,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -156,32 +240,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -217,21 +343,49 @@ CROSS JOIN ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month , subq_7.created_at__quarter , subq_7.created_at__year + , subq_7.created_at__extract_year + , subq_7.created_at__extract_quarter + , subq_7.created_at__extract_month + , subq_7.created_at__extract_week + , subq_7.created_at__extract_day + , subq_7.created_at__extract_dayofweek + , subq_7.created_at__extract_dayofyear , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month , subq_7.listing__ds__quarter , subq_7.listing__ds__year + , subq_7.listing__ds__extract_year + , subq_7.listing__ds__extract_quarter + , subq_7.listing__ds__extract_month + , subq_7.listing__ds__extract_week + , subq_7.listing__ds__extract_day + , subq_7.listing__ds__extract_dayofweek + , subq_7.listing__ds__extract_dayofyear , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month , subq_7.listing__created_at__quarter , subq_7.listing__created_at__year + , subq_7.listing__created_at__extract_year + , subq_7.listing__created_at__extract_quarter + , subq_7.listing__created_at__extract_month + , subq_7.listing__created_at__extract_week + , subq_7.listing__created_at__extract_day + , subq_7.listing__created_at__extract_dayofweek + , subq_7.listing__created_at__extract_dayofyear , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -257,21 +411,49 @@ CROSS JOIN ( , subq_6.ds__month , subq_6.ds__quarter , subq_6.ds__year + , subq_6.ds__extract_year + , subq_6.ds__extract_quarter + , subq_6.ds__extract_month + , subq_6.ds__extract_week + , subq_6.ds__extract_day + , subq_6.ds__extract_dayofweek + , subq_6.ds__extract_dayofyear , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month , subq_6.created_at__quarter , subq_6.created_at__year + , subq_6.created_at__extract_year + , subq_6.created_at__extract_quarter + , subq_6.created_at__extract_month + , subq_6.created_at__extract_week + , subq_6.created_at__extract_day + , subq_6.created_at__extract_dayofweek + , subq_6.created_at__extract_dayofyear , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month , subq_6.listing__ds__quarter , subq_6.listing__ds__year + , subq_6.listing__ds__extract_year + , subq_6.listing__ds__extract_quarter + , subq_6.listing__ds__extract_month + , subq_6.listing__ds__extract_week + , subq_6.listing__ds__extract_day + , subq_6.listing__ds__extract_dayofweek + , subq_6.listing__ds__extract_dayofyear , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month , subq_6.listing__created_at__quarter , subq_6.listing__created_at__year + , subq_6.listing__created_at__extract_year + , subq_6.listing__created_at__extract_quarter + , subq_6.listing__created_at__extract_month + , subq_6.listing__created_at__extract_week + , subq_6.listing__created_at__extract_day + , subq_6.listing__created_at__extract_dayofweek + , subq_6.listing__created_at__extract_dayofyear , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -300,11 +482,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -313,11 +509,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql index 14a9f0385a..7cc6e2d906 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql @@ -44,31 +44,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -118,32 +160,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -182,31 +266,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -256,32 +382,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,31 +500,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -406,32 +616,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -480,31 +732,73 @@ FROM ( , subq_17.ds__month , subq_17.ds__quarter , subq_17.ds__year + , subq_17.ds__extract_year + , subq_17.ds__extract_quarter + , subq_17.ds__extract_month + , subq_17.ds__extract_week + , subq_17.ds__extract_day + , subq_17.ds__extract_dayofweek + , subq_17.ds__extract_dayofyear , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month , subq_17.ds_partitioned__quarter , subq_17.ds_partitioned__year + , subq_17.ds_partitioned__extract_year + , subq_17.ds_partitioned__extract_quarter + , subq_17.ds_partitioned__extract_month + , subq_17.ds_partitioned__extract_week + , subq_17.ds_partitioned__extract_day + , subq_17.ds_partitioned__extract_dayofweek + , subq_17.ds_partitioned__extract_dayofyear , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month , subq_17.paid_at__quarter , subq_17.paid_at__year + , subq_17.paid_at__extract_year + , subq_17.paid_at__extract_quarter + , subq_17.paid_at__extract_month + , subq_17.paid_at__extract_week + , subq_17.paid_at__extract_day + , subq_17.paid_at__extract_dayofweek + , subq_17.paid_at__extract_dayofyear , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month , subq_17.booking__ds__quarter , subq_17.booking__ds__year + , subq_17.booking__ds__extract_year + , subq_17.booking__ds__extract_quarter + , subq_17.booking__ds__extract_month + , subq_17.booking__ds__extract_week + , subq_17.booking__ds__extract_day + , subq_17.booking__ds__extract_dayofweek + , subq_17.booking__ds__extract_dayofyear , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month , subq_17.booking__ds_partitioned__quarter , subq_17.booking__ds_partitioned__year + , subq_17.booking__ds_partitioned__extract_year + , subq_17.booking__ds_partitioned__extract_quarter + , subq_17.booking__ds_partitioned__extract_month + , subq_17.booking__ds_partitioned__extract_week + , subq_17.booking__ds_partitioned__extract_day + , subq_17.booking__ds_partitioned__extract_dayofweek + , subq_17.booking__ds_partitioned__extract_dayofyear , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month , subq_17.booking__paid_at__quarter , subq_17.booking__paid_at__year + , subq_17.booking__paid_at__extract_year + , subq_17.booking__paid_at__extract_quarter + , subq_17.booking__paid_at__extract_month + , subq_17.booking__paid_at__extract_week + , subq_17.booking__paid_at__extract_day + , subq_17.booking__paid_at__extract_dayofweek + , subq_17.booking__paid_at__extract_dayofyear , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -554,32 +848,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql index be96decab5..3ada9bf35a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql @@ -45,32 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql index a5288e7009..e7c3deecdb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month , subq_0.verification__ds__quarter , subq_0.verification__ds__year + , subq_0.verification__ds__extract_year + , subq_0.verification__ds__extract_quarter + , subq_0.verification__ds__extract_month + , subq_0.verification__ds__extract_week + , subq_0.verification__ds__extract_day + , subq_0.verification__ds__extract_dayofweek + , subq_0.verification__ds__extract_dayofyear , subq_0.verification__ds_partitioned__day , 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.verification__ds_partitioned__extract_year + , subq_0.verification__ds_partitioned__extract_quarter + , subq_0.verification__ds_partitioned__extract_month + , subq_0.verification__ds_partitioned__extract_week + , subq_0.verification__ds_partitioned__extract_day + , subq_0.verification__ds_partitioned__extract_dayofweek + , subq_0.verification__ds_partitioned__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -71,22 +99,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -110,32 +166,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek + , EXTRACT(DOY FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek + , EXTRACT(DOY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql index c65a58a300..f26bd34521 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -54,12 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql index 603dac8609..0e5972d3ea 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql index adfa1c3f03..fa1d4a6720 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 48a1b43de5..3c78b2147d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 08a913aa57..3dcd0390ef 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ed796b148d..e722f24125 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql index 782ccc2826..e2cc098fae 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -83,11 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -96,11 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql index 0f449eb59e..e337bd9061 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql index ee19129508..82a5abe48e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS paid_at__extract_dayofyear , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS booking__paid_at__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql index 214766cb17..073c7964da 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -239,32 +365,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql index 63637a9433..c80b16baf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 9c4d91d069..d5d52443ea 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -51,31 +51,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,32 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -175,21 +259,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -218,11 +330,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -231,11 +357,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -296,21 +436,49 @@ FROM ( , subq_10.ds__month , subq_10.ds__quarter , subq_10.ds__year + , subq_10.ds__extract_year + , subq_10.ds__extract_quarter + , subq_10.ds__extract_month + , subq_10.ds__extract_week + , subq_10.ds__extract_day + , subq_10.ds__extract_dayofweek + , subq_10.ds__extract_dayofyear , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month , subq_10.ds_partitioned__quarter , subq_10.ds_partitioned__year + , subq_10.ds_partitioned__extract_year + , subq_10.ds_partitioned__extract_quarter + , subq_10.ds_partitioned__extract_month + , subq_10.ds_partitioned__extract_week + , subq_10.ds_partitioned__extract_day + , subq_10.ds_partitioned__extract_dayofweek + , subq_10.ds_partitioned__extract_dayofyear , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month , subq_10.view__ds__quarter , subq_10.view__ds__year + , subq_10.view__ds__extract_year + , subq_10.view__ds__extract_quarter + , subq_10.view__ds__extract_month + , subq_10.view__ds__extract_week + , subq_10.view__ds__extract_day + , subq_10.view__ds__extract_dayofweek + , subq_10.view__ds__extract_dayofyear , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month , subq_10.view__ds_partitioned__quarter , subq_10.view__ds_partitioned__year + , subq_10.view__ds_partitioned__extract_year + , subq_10.view__ds_partitioned__extract_quarter + , subq_10.view__ds_partitioned__extract_month + , subq_10.view__ds_partitioned__extract_week + , subq_10.view__ds_partitioned__extract_day + , subq_10.view__ds_partitioned__extract_dayofweek + , subq_10.view__ds_partitioned__extract_dayofyear , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -330,21 +498,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -367,21 +563,49 @@ FROM ( , subq_13.ds__month , subq_13.ds__quarter , subq_13.ds__year + , subq_13.ds__extract_year + , subq_13.ds__extract_quarter + , subq_13.ds__extract_month + , subq_13.ds__extract_week + , subq_13.ds__extract_day + , subq_13.ds__extract_dayofweek + , subq_13.ds__extract_dayofyear , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month , subq_13.created_at__quarter , subq_13.created_at__year + , subq_13.created_at__extract_year + , subq_13.created_at__extract_quarter + , subq_13.created_at__extract_month + , subq_13.created_at__extract_week + , subq_13.created_at__extract_day + , subq_13.created_at__extract_dayofweek + , subq_13.created_at__extract_dayofyear , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month , subq_13.listing__ds__quarter , subq_13.listing__ds__year + , subq_13.listing__ds__extract_year + , subq_13.listing__ds__extract_quarter + , subq_13.listing__ds__extract_month + , subq_13.listing__ds__extract_week + , subq_13.listing__ds__extract_day + , subq_13.listing__ds__extract_dayofweek + , subq_13.listing__ds__extract_dayofyear , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month , subq_13.listing__created_at__quarter , subq_13.listing__created_at__year + , subq_13.listing__created_at__extract_year + , subq_13.listing__created_at__extract_quarter + , subq_13.listing__created_at__extract_month + , subq_13.listing__created_at__extract_week + , subq_13.listing__created_at__extract_day + , subq_13.listing__created_at__extract_dayofweek + , subq_13.listing__created_at__extract_dayofyear , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -410,11 +634,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -423,11 +661,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index dd55a54b61..a56183e745 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,32 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -99,11 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -112,11 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql index 48583b238a..b6f01861d7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql index 4ca35f2544..d480357663 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql @@ -38,32 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql index b515ad2da5..f52c8d6acf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql index 5eb893b84a..4e79154b70 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql index 2393630095..f44071348d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql @@ -18,11 +18,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -40,11 +54,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql index 9ced88e0cc..4c321e73b0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index dd00d2b15e..4821d797fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql index 658dcf3357..2a39c9282f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql index 9bafb5e1f6..82ded0a878 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -170,31 +254,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -244,32 +370,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql index edbbe545fd..f21c6e33a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index c97b8fd930..34b929887f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql index bbc8999a91..de24654075 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql index f9871f024a..3da362bd96 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 5906b2b836..001633ef6d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -235,31 +361,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -295,31 +463,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -369,32 +579,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index f8f4db398a..0d2a73ccaa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -236,31 +362,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -296,31 +464,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -370,32 +580,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql index b0135c14b3..11133f2d42 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter , subq_4.ds__year AS ds__year + , subq_4.ds__extract_year AS ds__extract_year + , subq_4.ds__extract_quarter AS ds__extract_quarter + , subq_4.ds__extract_month AS ds__extract_month + , subq_4.ds__extract_week AS ds__extract_week + , subq_4.ds__extract_day AS ds__extract_day + , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month , subq_4.ds_partitioned__quarter AS ds_partitioned__quarter , subq_4.ds_partitioned__year AS ds_partitioned__year + , subq_4.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month , subq_4.paid_at__quarter AS paid_at__quarter , subq_4.paid_at__year AS paid_at__year + , subq_4.paid_at__extract_year AS paid_at__extract_year + , subq_4.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_4.paid_at__extract_month AS paid_at__extract_month + , subq_4.paid_at__extract_week AS paid_at__extract_week + , subq_4.paid_at__extract_day AS paid_at__extract_day + , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month , subq_4.booking__ds__quarter AS booking__ds__quarter , subq_4.booking__ds__year AS booking__ds__year + , subq_4.booking__ds__extract_year AS booking__ds__extract_year + , subq_4.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_4.booking__ds__extract_month AS booking__ds__extract_month + , subq_4.booking__ds__extract_week AS booking__ds__extract_week + , subq_4.booking__ds__extract_day AS booking__ds__extract_day + , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_4.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_4.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_4.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_4.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month , subq_4.booking__paid_at__quarter AS booking__paid_at__quarter , subq_4.booking__paid_at__year AS booking__paid_at__year + , subq_4.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_4.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -88,31 +130,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -152,31 +236,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -226,32 +352,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql index f9062ca85f..467707f734 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -87,31 +129,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -161,32 +245,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql index 870b2c80ea..3adff18e62 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql @@ -42,31 +42,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,32 +158,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -166,21 +250,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -209,11 +321,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -222,11 +348,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql index ddba65921c..00efad0383 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql @@ -25,32 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql index 7ce1a71c7f..7e0fdff19e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql index 81e6d39ada..eb70f04221 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -48,31 +48,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,32 +164,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -172,21 +256,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -215,11 +327,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -228,11 +354,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql index 4caa3d07f0..a1b2d01a0f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__day AS listing__window_end__day + , subq_4.window_start__extract_month AS listing__window_start__extract_month + , subq_4.window_end__extract_quarter AS listing__window_end__extract_quarter , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -50,31 +50,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -110,32 +152,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -152,8 +236,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__day - , subq_3.window_end__day + subq_3.window_start__extract_month + , subq_3.window_end__extract_quarter , subq_3.listing , subq_3.capacity FROM ( @@ -164,11 +248,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -177,11 +275,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -196,12 +308,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__day + subq_2.metric_time__day >= subq_4.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__day + subq_2.metric_time__day < subq_4.window_end__extract_quarter ) OR ( - subq_4.window_end__day IS NULL + subq_4.window_end__extract_quarter IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql index 86a2010b35..28a4fe2ec0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < EXTRACT(QUARTER FROM listings_src_10017.active_to) ) OR ( - listings_src_10017.active_to IS NULL + EXTRACT(QUARTER FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ed1bd4e99..6ef8853985 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql index 0834ca012d..18e509dd5c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql index 027f20ea5b..16e8afe8d0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql index 913fed793c..b00d690648 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql @@ -26,31 +26,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql index 86b30c4553..583b4a4bf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql @@ -21,21 +21,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month , subq_0.created_at__quarter , subq_0.created_at__year + , subq_0.created_at__extract_year + , subq_0.created_at__extract_quarter + , subq_0.created_at__extract_month + , subq_0.created_at__extract_week + , subq_0.created_at__extract_day + , subq_0.created_at__extract_dayofweek + , subq_0.created_at__extract_dayofyear , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month , subq_0.listing__ds__quarter , subq_0.listing__ds__year + , subq_0.listing__ds__extract_year + , subq_0.listing__ds__extract_quarter + , subq_0.listing__ds__extract_month + , subq_0.listing__ds__extract_week + , subq_0.listing__ds__extract_day + , subq_0.listing__ds__extract_dayofweek + , subq_0.listing__ds__extract_dayofyear , subq_0.listing__created_at__day , 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.listing__created_at__extract_year + , subq_0.listing__created_at__extract_quarter + , subq_0.listing__created_at__extract_month + , subq_0.listing__created_at__extract_week + , subq_0.listing__created_at__extract_day + , subq_0.listing__created_at__extract_dayofweek + , subq_0.listing__created_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -77,11 +119,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql index 316737d00a..b05da97264 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql @@ -35,32 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql index 73e6a70d92..437dc887b4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql @@ -60,31 +60,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -134,32 +176,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -184,21 +268,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -227,11 +339,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -240,11 +366,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -317,31 +457,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -391,32 +573,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -441,21 +665,49 @@ FROM ( , subq_15.ds__month , subq_15.ds__quarter , subq_15.ds__year + , subq_15.ds__extract_year + , subq_15.ds__extract_quarter + , subq_15.ds__extract_month + , subq_15.ds__extract_week + , subq_15.ds__extract_day + , subq_15.ds__extract_dayofweek + , subq_15.ds__extract_dayofyear , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month , subq_15.created_at__quarter , subq_15.created_at__year + , subq_15.created_at__extract_year + , subq_15.created_at__extract_quarter + , subq_15.created_at__extract_month + , subq_15.created_at__extract_week + , subq_15.created_at__extract_day + , subq_15.created_at__extract_dayofweek + , subq_15.created_at__extract_dayofyear , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month , subq_15.listing__ds__quarter , subq_15.listing__ds__year + , subq_15.listing__ds__extract_year + , subq_15.listing__ds__extract_quarter + , subq_15.listing__ds__extract_month + , subq_15.listing__ds__extract_week + , subq_15.listing__ds__extract_day + , subq_15.listing__ds__extract_dayofweek + , subq_15.listing__ds__extract_dayofyear , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month , subq_15.listing__created_at__quarter , subq_15.listing__created_at__year + , subq_15.listing__created_at__extract_year + , subq_15.listing__created_at__extract_quarter + , subq_15.listing__created_at__extract_month + , subq_15.listing__created_at__extract_week + , subq_15.listing__created_at__extract_day + , subq_15.listing__created_at__extract_dayofweek + , subq_15.listing__created_at__extract_dayofyear , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -484,11 +736,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -497,11 +763,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -557,31 +837,73 @@ FROM ( , subq_24.ds__month , subq_24.ds__quarter , subq_24.ds__year + , subq_24.ds__extract_year + , subq_24.ds__extract_quarter + , subq_24.ds__extract_month + , subq_24.ds__extract_week + , subq_24.ds__extract_day + , subq_24.ds__extract_dayofweek + , subq_24.ds__extract_dayofyear , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month , subq_24.ds_partitioned__quarter , subq_24.ds_partitioned__year + , subq_24.ds_partitioned__extract_year + , subq_24.ds_partitioned__extract_quarter + , subq_24.ds_partitioned__extract_month + , subq_24.ds_partitioned__extract_week + , subq_24.ds_partitioned__extract_day + , subq_24.ds_partitioned__extract_dayofweek + , subq_24.ds_partitioned__extract_dayofyear , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month , subq_24.paid_at__quarter , subq_24.paid_at__year + , subq_24.paid_at__extract_year + , subq_24.paid_at__extract_quarter + , subq_24.paid_at__extract_month + , subq_24.paid_at__extract_week + , subq_24.paid_at__extract_day + , subq_24.paid_at__extract_dayofweek + , subq_24.paid_at__extract_dayofyear , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month , subq_24.booking__ds__quarter , subq_24.booking__ds__year + , subq_24.booking__ds__extract_year + , subq_24.booking__ds__extract_quarter + , subq_24.booking__ds__extract_month + , subq_24.booking__ds__extract_week + , subq_24.booking__ds__extract_day + , subq_24.booking__ds__extract_dayofweek + , subq_24.booking__ds__extract_dayofyear , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month , subq_24.booking__ds_partitioned__quarter , subq_24.booking__ds_partitioned__year + , subq_24.booking__ds_partitioned__extract_year + , subq_24.booking__ds_partitioned__extract_quarter + , subq_24.booking__ds_partitioned__extract_month + , subq_24.booking__ds_partitioned__extract_week + , subq_24.booking__ds_partitioned__extract_day + , subq_24.booking__ds_partitioned__extract_dayofweek + , subq_24.booking__ds_partitioned__extract_dayofyear , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month , subq_24.booking__paid_at__quarter , subq_24.booking__paid_at__year + , subq_24.booking__paid_at__extract_year + , subq_24.booking__paid_at__extract_quarter + , subq_24.booking__paid_at__extract_month + , subq_24.booking__paid_at__extract_week + , subq_24.booking__paid_at__extract_day + , subq_24.booking__paid_at__extract_dayofweek + , subq_24.booking__paid_at__extract_dayofyear , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -631,32 +953,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql index 4176ca90e9..37ad3a608e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql @@ -45,31 +45,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,32 +161,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -186,31 +270,73 @@ FROM ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month , subq_7.ds_partitioned__quarter , subq_7.ds_partitioned__year + , subq_7.ds_partitioned__extract_year + , subq_7.ds_partitioned__extract_quarter + , subq_7.ds_partitioned__extract_month + , subq_7.ds_partitioned__extract_week + , subq_7.ds_partitioned__extract_day + , subq_7.ds_partitioned__extract_dayofweek + , subq_7.ds_partitioned__extract_dayofyear , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month , subq_7.paid_at__quarter , subq_7.paid_at__year + , subq_7.paid_at__extract_year + , subq_7.paid_at__extract_quarter + , subq_7.paid_at__extract_month + , subq_7.paid_at__extract_week + , subq_7.paid_at__extract_day + , subq_7.paid_at__extract_dayofweek + , subq_7.paid_at__extract_dayofyear , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month , subq_7.booking__ds__quarter , subq_7.booking__ds__year + , subq_7.booking__ds__extract_year + , subq_7.booking__ds__extract_quarter + , subq_7.booking__ds__extract_month + , subq_7.booking__ds__extract_week + , subq_7.booking__ds__extract_day + , subq_7.booking__ds__extract_dayofweek + , subq_7.booking__ds__extract_dayofyear , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month , subq_7.booking__ds_partitioned__quarter , subq_7.booking__ds_partitioned__year + , subq_7.booking__ds_partitioned__extract_year + , subq_7.booking__ds_partitioned__extract_quarter + , subq_7.booking__ds_partitioned__extract_month + , subq_7.booking__ds_partitioned__extract_week + , subq_7.booking__ds_partitioned__extract_day + , subq_7.booking__ds_partitioned__extract_dayofweek + , subq_7.booking__ds_partitioned__extract_dayofyear , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month , subq_7.booking__paid_at__quarter , subq_7.booking__paid_at__year + , subq_7.booking__paid_at__extract_year + , subq_7.booking__paid_at__extract_quarter + , subq_7.booking__paid_at__extract_month + , subq_7.booking__paid_at__extract_week + , subq_7.booking__paid_at__extract_day + , subq_7.booking__paid_at__extract_dayofweek + , subq_7.booking__paid_at__extract_dayofyear , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -260,32 +386,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 13d80a91d0..a495423238 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -39,31 +39,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -113,32 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 14ec230f17..0e4cdb1a6a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -160,21 +244,49 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month , subq_5.created_at__quarter , subq_5.created_at__year + , subq_5.created_at__extract_year + , subq_5.created_at__extract_quarter + , subq_5.created_at__extract_month + , subq_5.created_at__extract_week + , subq_5.created_at__extract_day + , subq_5.created_at__extract_dayofweek + , subq_5.created_at__extract_dayofyear , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month , subq_5.listing__ds__quarter , subq_5.listing__ds__year + , subq_5.listing__ds__extract_year + , subq_5.listing__ds__extract_quarter + , subq_5.listing__ds__extract_month + , subq_5.listing__ds__extract_week + , subq_5.listing__ds__extract_day + , subq_5.listing__ds__extract_dayofweek + , subq_5.listing__ds__extract_dayofyear , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month , subq_5.listing__created_at__quarter , subq_5.listing__created_at__year + , subq_5.listing__created_at__extract_year + , subq_5.listing__created_at__extract_quarter + , subq_5.listing__created_at__extract_month + , subq_5.listing__created_at__extract_week + , subq_5.listing__created_at__extract_day + , subq_5.listing__created_at__extract_dayofweek + , subq_5.listing__created_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -203,11 +315,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -216,11 +342,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql index 88cc0b431d..c65a26cd35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__day AS listing__window_start__day - , subq_7.window_end__day AS listing__window_end__day + , subq_7.window_start__extract_month AS listing__window_start__extract_month + , subq_7.window_end__extract_quarter AS listing__window_end__extract_quarter , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -142,8 +226,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__day - , subq_6.window_end__day + subq_6.window_start__extract_month + , subq_6.window_end__extract_quarter , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -154,26 +238,61 @@ FROM ( , subq_3.window_start__month AS window_start__month , subq_3.window_start__quarter AS window_start__quarter , subq_3.window_start__year AS window_start__year + , subq_3.window_start__extract_year AS window_start__extract_year + , subq_3.window_start__extract_quarter AS window_start__extract_quarter + , subq_3.window_start__extract_month AS window_start__extract_month + , subq_3.window_start__extract_week AS window_start__extract_week + , subq_3.window_start__extract_day AS window_start__extract_day + , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek + , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month , subq_3.window_end__quarter AS window_end__quarter , subq_3.window_end__year AS window_end__year + , subq_3.window_end__extract_year AS window_end__extract_year + , subq_3.window_end__extract_quarter AS window_end__extract_quarter + , subq_3.window_end__extract_month AS window_end__extract_month + , subq_3.window_end__extract_week AS window_end__extract_week + , subq_3.window_end__extract_day AS window_end__extract_day + , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek + , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month , subq_3.listing__window_start__quarter AS listing__window_start__quarter , subq_3.listing__window_start__year AS listing__window_start__year + , subq_3.listing__window_start__extract_year AS listing__window_start__extract_year + , subq_3.listing__window_start__extract_quarter AS listing__window_start__extract_quarter + , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month + , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week + , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day + , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek + , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month , subq_3.listing__window_end__quarter AS listing__window_end__quarter , subq_3.listing__window_end__year AS listing__window_end__year + , subq_3.listing__window_end__extract_year AS listing__window_end__extract_year + , subq_3.listing__window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month + , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week + , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day + , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month , subq_5.ds__quarter AS user__ds__quarter , subq_5.ds__year AS user__ds__year + , subq_5.ds__extract_year AS user__ds__extract_year + , subq_5.ds__extract_quarter AS user__ds__extract_quarter + , subq_5.ds__extract_month AS user__ds__extract_month + , subq_5.ds__extract_week AS user__ds__extract_week + , subq_5.ds__extract_day AS user__ds__extract_day + , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek + , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -192,11 +311,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -205,11 +338,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -227,11 +374,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', -- 'user'] SELECT subq_4.ds__day @@ -239,11 +400,25 @@ FROM ( , subq_4.ds__month , subq_4.ds__quarter , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_week + , subq_4.ds__extract_day + , subq_4.ds__extract_dayofweek + , subq_4.ds__extract_dayofyear , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month , subq_4.user__ds__quarter , subq_4.user__ds__year + , subq_4.user__ds__extract_year + , subq_4.user__ds__extract_quarter + , subq_4.user__ds__extract_month + , subq_4.user__ds__extract_week + , subq_4.user__ds__extract_day + , subq_4.user__ds__extract_dayofweek + , subq_4.user__ds__extract_dayofyear , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -255,12 +430,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 @@ -275,12 +464,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__day + subq_2.metric_time__day >= subq_7.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__day + subq_2.metric_time__day < subq_7.window_end__extract_quarter ) OR ( - subq_7.window_end__day IS NULL + subq_7.window_end__extract_quarter IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql index feb5ed0fdc..7633c731a1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day + EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__day + subq_13.metric_time__day >= subq_18.window_start__extract_month ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__day + subq_13.metric_time__day < subq_18.window_end__extract_quarter ) OR ( - subq_18.window_end__day IS NULL + subq_18.window_end__extract_quarter IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql index 94054a124c..a451f1ac42 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql @@ -21,7 +21,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day + , subq_7.lux_listing__window_end__extract_day AS listing__lux_listing__window_end__extract_day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -146,7 +230,7 @@ FROM ( -- 'listing'] SELECT subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__day + , subq_6.lux_listing__window_end__extract_day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -157,11 +241,25 @@ FROM ( , subq_5.window_start__month AS lux_listing__window_start__month , subq_5.window_start__quarter AS lux_listing__window_start__quarter , subq_5.window_start__year AS lux_listing__window_start__year + , subq_5.window_start__extract_year AS lux_listing__window_start__extract_year + , subq_5.window_start__extract_quarter AS lux_listing__window_start__extract_quarter + , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month + , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week + , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day + , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek + , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month , subq_5.window_end__quarter AS lux_listing__window_end__quarter , subq_5.window_end__year AS lux_listing__window_end__year + , subq_5.window_end__extract_year AS lux_listing__window_end__extract_year + , subq_5.window_end__extract_quarter AS lux_listing__window_end__extract_quarter + , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month + , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week + , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day + , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek + , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -183,21 +281,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -205,21 +331,49 @@ FROM ( , subq_4.window_start__month , subq_4.window_start__quarter , subq_4.window_start__year + , subq_4.window_start__extract_year + , subq_4.window_start__extract_quarter + , subq_4.window_start__extract_month + , subq_4.window_start__extract_week + , subq_4.window_start__extract_day + , subq_4.window_start__extract_dayofweek + , subq_4.window_start__extract_dayofyear , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month , subq_4.window_end__quarter , subq_4.window_end__year + , subq_4.window_end__extract_year + , subq_4.window_end__extract_quarter + , subq_4.window_end__extract_month + , subq_4.window_end__extract_week + , subq_4.window_end__extract_day + , subq_4.window_end__extract_dayofweek + , subq_4.window_end__extract_dayofyear , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month , subq_4.lux_listing__window_start__quarter , subq_4.lux_listing__window_start__year + , subq_4.lux_listing__window_start__extract_year + , subq_4.lux_listing__window_start__extract_quarter + , subq_4.lux_listing__window_start__extract_month + , subq_4.lux_listing__window_start__extract_week + , subq_4.lux_listing__window_start__extract_day + , subq_4.lux_listing__window_start__extract_dayofweek + , subq_4.lux_listing__window_start__extract_dayofyear , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month , subq_4.lux_listing__window_end__quarter , subq_4.lux_listing__window_end__year + , subq_4.lux_listing__window_end__extract_year + , subq_4.lux_listing__window_end__extract_quarter + , subq_4.lux_listing__window_end__extract_month + , subq_4.lux_listing__window_end__extract_week + , subq_4.lux_listing__window_end__extract_day + , subq_4.lux_listing__window_end__extract_dayofweek + , subq_4.lux_listing__window_end__extract_dayofyear , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -231,22 +385,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 @@ -264,9 +446,9 @@ FROM ( subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__day + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_day ) OR ( - subq_7.lux_listing__window_end__day IS NULL + subq_7.lux_listing__window_end__extract_day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql index f1b419a284..ff50adbf8b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -27,7 +27,7 @@ LEFT OUTER JOIN ( -- 'listing'] SELECT lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -44,9 +44,9 @@ ON subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__day + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_day ) OR ( - subq_18.lux_listing__window_end__day IS NULL + subq_18.lux_listing__window_end__extract_day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql index ae8b7838b7..cb9670f074 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql @@ -33,32 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -85,11 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -98,11 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -131,11 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -144,11 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql index d35179ebf0..fbddd59f54 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.account_id__ds_partitioned__day , 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_partitioned__extract_year + , subq_0.account_id__ds_partitioned__extract_quarter + , subq_0.account_id__ds_partitioned__extract_month + , subq_0.account_id__ds_partitioned__extract_week + , subq_0.account_id__ds_partitioned__extract_day + , subq_0.account_id__ds_partitioned__extract_dayofweek + , subq_0.account_id__ds_partitioned__extract_dayofyear , subq_0.account_id__ds__day , 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.account_id__ds__extract_year + , subq_0.account_id__ds__extract_quarter + , subq_0.account_id__ds__extract_month + , subq_0.account_id__ds__extract_week + , subq_0.account_id__ds__extract_day + , subq_0.account_id__ds__extract_dayofweek + , subq_0.account_id__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -69,22 +97,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -106,16 +162,37 @@ FROM ( , 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.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_3.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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_3.account_id__ds_partitioned__extract_year AS account_id__ds_partitioned__extract_year + , subq_3.account_id__ds_partitioned__extract_quarter AS account_id__ds_partitioned__extract_quarter + , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month + , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week + , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day + , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek + , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , 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_5.ds_partitioned__extract_year AS customer_id__ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter AS customer_id__ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear , 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 @@ -132,12 +209,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -154,11 +245,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -166,11 +271,25 @@ FROM ( , subq_4.ds_partitioned__month , subq_4.ds_partitioned__quarter , subq_4.ds_partitioned__year + , subq_4.ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear , subq_4.customer_id__ds_partitioned__day , 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__ds_partitioned__extract_year + , subq_4.customer_id__ds_partitioned__extract_quarter + , subq_4.customer_id__ds_partitioned__extract_month + , subq_4.customer_id__ds_partitioned__extract_week + , subq_4.customer_id__ds_partitioned__extract_day + , subq_4.customer_id__ds_partitioned__extract_dayofweek + , subq_4.customer_id__ds_partitioned__extract_dayofyear , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -186,6 +305,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -193,6 +319,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql index 5c9089deaf..eb31a4fb3a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql @@ -23,31 +23,73 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month , subq_1.ds_partitioned__quarter , subq_1.ds_partitioned__year + , subq_1.ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month , subq_1.paid_at__quarter , subq_1.paid_at__year + , subq_1.paid_at__extract_year + , subq_1.paid_at__extract_quarter + , subq_1.paid_at__extract_month + , subq_1.paid_at__extract_week + , subq_1.paid_at__extract_day + , subq_1.paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month , subq_1.booking__ds__quarter , subq_1.booking__ds__year + , subq_1.booking__ds__extract_year + , subq_1.booking__ds__extract_quarter + , subq_1.booking__ds__extract_month + , subq_1.booking__ds__extract_week + , subq_1.booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month , subq_1.booking__paid_at__quarter , subq_1.booking__paid_at__year + , subq_1.booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -82,31 +124,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -156,32 +240,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -217,21 +343,49 @@ CROSS JOIN ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month , subq_7.created_at__quarter , subq_7.created_at__year + , subq_7.created_at__extract_year + , subq_7.created_at__extract_quarter + , subq_7.created_at__extract_month + , subq_7.created_at__extract_week + , subq_7.created_at__extract_day + , subq_7.created_at__extract_dayofweek + , subq_7.created_at__extract_dayofyear , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month , subq_7.listing__ds__quarter , subq_7.listing__ds__year + , subq_7.listing__ds__extract_year + , subq_7.listing__ds__extract_quarter + , subq_7.listing__ds__extract_month + , subq_7.listing__ds__extract_week + , subq_7.listing__ds__extract_day + , subq_7.listing__ds__extract_dayofweek + , subq_7.listing__ds__extract_dayofyear , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month , subq_7.listing__created_at__quarter , subq_7.listing__created_at__year + , subq_7.listing__created_at__extract_year + , subq_7.listing__created_at__extract_quarter + , subq_7.listing__created_at__extract_month + , subq_7.listing__created_at__extract_week + , subq_7.listing__created_at__extract_day + , subq_7.listing__created_at__extract_dayofweek + , subq_7.listing__created_at__extract_dayofyear , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -257,21 +411,49 @@ CROSS JOIN ( , subq_6.ds__month , subq_6.ds__quarter , subq_6.ds__year + , subq_6.ds__extract_year + , subq_6.ds__extract_quarter + , subq_6.ds__extract_month + , subq_6.ds__extract_week + , subq_6.ds__extract_day + , subq_6.ds__extract_dayofweek + , subq_6.ds__extract_dayofyear , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month , subq_6.created_at__quarter , subq_6.created_at__year + , subq_6.created_at__extract_year + , subq_6.created_at__extract_quarter + , subq_6.created_at__extract_month + , subq_6.created_at__extract_week + , subq_6.created_at__extract_day + , subq_6.created_at__extract_dayofweek + , subq_6.created_at__extract_dayofyear , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month , subq_6.listing__ds__quarter , subq_6.listing__ds__year + , subq_6.listing__ds__extract_year + , subq_6.listing__ds__extract_quarter + , subq_6.listing__ds__extract_month + , subq_6.listing__ds__extract_week + , subq_6.listing__ds__extract_day + , subq_6.listing__ds__extract_dayofweek + , subq_6.listing__ds__extract_dayofyear , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month , subq_6.listing__created_at__quarter , subq_6.listing__created_at__year + , subq_6.listing__created_at__extract_year + , subq_6.listing__created_at__extract_quarter + , subq_6.listing__created_at__extract_month + , subq_6.listing__created_at__extract_week + , subq_6.listing__created_at__extract_day + , subq_6.listing__created_at__extract_dayofweek + , subq_6.listing__created_at__extract_dayofyear , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -300,11 +482,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -313,11 +509,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql index 14a9f0385a..dc0afd0f09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql @@ -44,31 +44,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -118,32 +160,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -182,31 +266,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -256,32 +382,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,31 +500,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -406,32 +616,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -480,31 +732,73 @@ FROM ( , subq_17.ds__month , subq_17.ds__quarter , subq_17.ds__year + , subq_17.ds__extract_year + , subq_17.ds__extract_quarter + , subq_17.ds__extract_month + , subq_17.ds__extract_week + , subq_17.ds__extract_day + , subq_17.ds__extract_dayofweek + , subq_17.ds__extract_dayofyear , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month , subq_17.ds_partitioned__quarter , subq_17.ds_partitioned__year + , subq_17.ds_partitioned__extract_year + , subq_17.ds_partitioned__extract_quarter + , subq_17.ds_partitioned__extract_month + , subq_17.ds_partitioned__extract_week + , subq_17.ds_partitioned__extract_day + , subq_17.ds_partitioned__extract_dayofweek + , subq_17.ds_partitioned__extract_dayofyear , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month , subq_17.paid_at__quarter , subq_17.paid_at__year + , subq_17.paid_at__extract_year + , subq_17.paid_at__extract_quarter + , subq_17.paid_at__extract_month + , subq_17.paid_at__extract_week + , subq_17.paid_at__extract_day + , subq_17.paid_at__extract_dayofweek + , subq_17.paid_at__extract_dayofyear , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month , subq_17.booking__ds__quarter , subq_17.booking__ds__year + , subq_17.booking__ds__extract_year + , subq_17.booking__ds__extract_quarter + , subq_17.booking__ds__extract_month + , subq_17.booking__ds__extract_week + , subq_17.booking__ds__extract_day + , subq_17.booking__ds__extract_dayofweek + , subq_17.booking__ds__extract_dayofyear , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month , subq_17.booking__ds_partitioned__quarter , subq_17.booking__ds_partitioned__year + , subq_17.booking__ds_partitioned__extract_year + , subq_17.booking__ds_partitioned__extract_quarter + , subq_17.booking__ds_partitioned__extract_month + , subq_17.booking__ds_partitioned__extract_week + , subq_17.booking__ds_partitioned__extract_day + , subq_17.booking__ds_partitioned__extract_dayofweek + , subq_17.booking__ds_partitioned__extract_dayofyear , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month , subq_17.booking__paid_at__quarter , subq_17.booking__paid_at__year + , subq_17.booking__paid_at__extract_year + , subq_17.booking__paid_at__extract_quarter + , subq_17.booking__paid_at__extract_month + , subq_17.booking__paid_at__extract_week + , subq_17.booking__paid_at__extract_day + , subq_17.booking__paid_at__extract_dayofweek + , subq_17.booking__paid_at__extract_dayofyear , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -554,32 +848,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql index be96decab5..63116a5458 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql @@ -45,32 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql index a5288e7009..a53f3a075b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month , subq_0.verification__ds__quarter , subq_0.verification__ds__year + , subq_0.verification__ds__extract_year + , subq_0.verification__ds__extract_quarter + , subq_0.verification__ds__extract_month + , subq_0.verification__ds__extract_week + , subq_0.verification__ds__extract_day + , subq_0.verification__ds__extract_dayofweek + , subq_0.verification__ds__extract_dayofyear , subq_0.verification__ds_partitioned__day , 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.verification__ds_partitioned__extract_year + , subq_0.verification__ds_partitioned__extract_quarter + , subq_0.verification__ds_partitioned__extract_month + , subq_0.verification__ds_partitioned__extract_week + , subq_0.verification__ds_partitioned__extract_day + , subq_0.verification__ds_partitioned__extract_dayofweek + , subq_0.verification__ds_partitioned__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -71,22 +99,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -110,32 +166,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql index c65a58a300..d88d2d32f3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -54,12 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql index 603dac8609..094486f462 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql index adfa1c3f03..a8a26c9899 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 48a1b43de5..c400372dd4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 08a913aa57..30ab4c1851 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ed796b148d..ef337f422c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql index 782ccc2826..16b897731d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -83,11 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -96,11 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql index 0f449eb59e..7dd5c3b39d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql index ee19129508..e240956212 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql index 214766cb17..073c7964da 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -239,32 +365,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql index 63637a9433..c80b16baf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index f9ef4e1727..5f9a321abd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -51,31 +51,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,32 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -175,21 +259,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -218,11 +330,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -231,11 +357,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -296,21 +436,49 @@ FROM ( , subq_10.ds__month , subq_10.ds__quarter , subq_10.ds__year + , subq_10.ds__extract_year + , subq_10.ds__extract_quarter + , subq_10.ds__extract_month + , subq_10.ds__extract_week + , subq_10.ds__extract_day + , subq_10.ds__extract_dayofweek + , subq_10.ds__extract_dayofyear , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month , subq_10.ds_partitioned__quarter , subq_10.ds_partitioned__year + , subq_10.ds_partitioned__extract_year + , subq_10.ds_partitioned__extract_quarter + , subq_10.ds_partitioned__extract_month + , subq_10.ds_partitioned__extract_week + , subq_10.ds_partitioned__extract_day + , subq_10.ds_partitioned__extract_dayofweek + , subq_10.ds_partitioned__extract_dayofyear , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month , subq_10.view__ds__quarter , subq_10.view__ds__year + , subq_10.view__ds__extract_year + , subq_10.view__ds__extract_quarter + , subq_10.view__ds__extract_month + , subq_10.view__ds__extract_week + , subq_10.view__ds__extract_day + , subq_10.view__ds__extract_dayofweek + , subq_10.view__ds__extract_dayofyear , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month , subq_10.view__ds_partitioned__quarter , subq_10.view__ds_partitioned__year + , subq_10.view__ds_partitioned__extract_year + , subq_10.view__ds_partitioned__extract_quarter + , subq_10.view__ds_partitioned__extract_month + , subq_10.view__ds_partitioned__extract_week + , subq_10.view__ds_partitioned__extract_day + , subq_10.view__ds_partitioned__extract_dayofweek + , subq_10.view__ds_partitioned__extract_dayofyear , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -330,21 +498,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -367,21 +563,49 @@ FROM ( , subq_13.ds__month , subq_13.ds__quarter , subq_13.ds__year + , subq_13.ds__extract_year + , subq_13.ds__extract_quarter + , subq_13.ds__extract_month + , subq_13.ds__extract_week + , subq_13.ds__extract_day + , subq_13.ds__extract_dayofweek + , subq_13.ds__extract_dayofyear , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month , subq_13.created_at__quarter , subq_13.created_at__year + , subq_13.created_at__extract_year + , subq_13.created_at__extract_quarter + , subq_13.created_at__extract_month + , subq_13.created_at__extract_week + , subq_13.created_at__extract_day + , subq_13.created_at__extract_dayofweek + , subq_13.created_at__extract_dayofyear , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month , subq_13.listing__ds__quarter , subq_13.listing__ds__year + , subq_13.listing__ds__extract_year + , subq_13.listing__ds__extract_quarter + , subq_13.listing__ds__extract_month + , subq_13.listing__ds__extract_week + , subq_13.listing__ds__extract_day + , subq_13.listing__ds__extract_dayofweek + , subq_13.listing__ds__extract_dayofyear , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month , subq_13.listing__created_at__quarter , subq_13.listing__created_at__year + , subq_13.listing__created_at__extract_year + , subq_13.listing__created_at__extract_quarter + , subq_13.listing__created_at__extract_month + , subq_13.listing__created_at__extract_week + , subq_13.listing__created_at__extract_day + , subq_13.listing__created_at__extract_dayofweek + , subq_13.listing__created_at__extract_dayofyear , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -410,11 +634,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -423,11 +661,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index e424fa31af..b2d5615477 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,32 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -99,11 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -112,11 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql index 48583b238a..b6f01861d7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql index 4ca35f2544..d480357663 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql @@ -38,32 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql index b515ad2da5..f52c8d6acf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql index 5eb893b84a..4e79154b70 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql index 2393630095..f44071348d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql @@ -18,11 +18,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -40,11 +54,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql index 9ced88e0cc..4c321e73b0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index dd00d2b15e..4821d797fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql index 658dcf3357..2a39c9282f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql index 9bafb5e1f6..82ded0a878 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -170,31 +254,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -244,32 +370,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql index edbbe545fd..f21c6e33a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index c97b8fd930..34b929887f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql index 99b1685e16..dc71eeec86 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 7b95fddac1..de37ca714a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 954c695598..eb915512e3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -235,31 +361,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -295,31 +463,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -369,32 +579,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 40acec4cf6..bd5554a5b6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -236,31 +362,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -296,31 +464,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -370,32 +580,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql index b2b0889336..209f65b14c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter , subq_4.ds__year AS ds__year + , subq_4.ds__extract_year AS ds__extract_year + , subq_4.ds__extract_quarter AS ds__extract_quarter + , subq_4.ds__extract_month AS ds__extract_month + , subq_4.ds__extract_week AS ds__extract_week + , subq_4.ds__extract_day AS ds__extract_day + , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month , subq_4.ds_partitioned__quarter AS ds_partitioned__quarter , subq_4.ds_partitioned__year AS ds_partitioned__year + , subq_4.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month , subq_4.paid_at__quarter AS paid_at__quarter , subq_4.paid_at__year AS paid_at__year + , subq_4.paid_at__extract_year AS paid_at__extract_year + , subq_4.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_4.paid_at__extract_month AS paid_at__extract_month + , subq_4.paid_at__extract_week AS paid_at__extract_week + , subq_4.paid_at__extract_day AS paid_at__extract_day + , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month , subq_4.booking__ds__quarter AS booking__ds__quarter , subq_4.booking__ds__year AS booking__ds__year + , subq_4.booking__ds__extract_year AS booking__ds__extract_year + , subq_4.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_4.booking__ds__extract_month AS booking__ds__extract_month + , subq_4.booking__ds__extract_week AS booking__ds__extract_week + , subq_4.booking__ds__extract_day AS booking__ds__extract_day + , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_4.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_4.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_4.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_4.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month , subq_4.booking__paid_at__quarter AS booking__paid_at__quarter , subq_4.booking__paid_at__year AS booking__paid_at__year + , subq_4.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_4.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -88,31 +130,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -152,31 +236,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -226,32 +352,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql index 73717860f9..6b3ac53490 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -87,31 +129,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -161,32 +245,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql index 870b2c80ea..3adff18e62 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql @@ -42,31 +42,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,32 +158,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -166,21 +250,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -209,11 +321,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -222,11 +348,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql index ddba65921c..00efad0383 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql @@ -25,32 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql index 7ce1a71c7f..7e0fdff19e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql index 81e6d39ada..eb70f04221 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -48,31 +48,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,32 +164,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -172,21 +256,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -215,11 +327,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -228,11 +354,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql index 4caa3d07f0..fa5e69d429 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql @@ -30,7 +30,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__day AS listing__window_start__day + , subq_4.window_start__extract_week AS listing__window_start__extract_week , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity @@ -50,31 +50,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -110,32 +152,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -152,7 +236,7 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__day + subq_3.window_start__extract_week , subq_3.window_end__day , subq_3.listing , subq_3.capacity @@ -164,11 +248,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -177,11 +275,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -196,7 +308,7 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__day + subq_2.metric_time__day >= subq_4.window_start__extract_week ) AND ( ( subq_2.metric_time__day < subq_4.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql index 86a2010b35..fcdd8a3083 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,7 +32,7 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= EXTRACT(WEEK FROM listings_src_10017.active_from) ) AND ( ( subq_12.metric_time__day < listings_src_10017.active_to diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ed1bd4e99..6ef8853985 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql index a26b98d66d..8e64ced98e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql index 027f20ea5b..16e8afe8d0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql index 913fed793c..b00d690648 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql @@ -26,31 +26,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql index 86b30c4553..583b4a4bf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql @@ -21,21 +21,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month , subq_0.created_at__quarter , subq_0.created_at__year + , subq_0.created_at__extract_year + , subq_0.created_at__extract_quarter + , subq_0.created_at__extract_month + , subq_0.created_at__extract_week + , subq_0.created_at__extract_day + , subq_0.created_at__extract_dayofweek + , subq_0.created_at__extract_dayofyear , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month , subq_0.listing__ds__quarter , subq_0.listing__ds__year + , subq_0.listing__ds__extract_year + , subq_0.listing__ds__extract_quarter + , subq_0.listing__ds__extract_month + , subq_0.listing__ds__extract_week + , subq_0.listing__ds__extract_day + , subq_0.listing__ds__extract_dayofweek + , subq_0.listing__ds__extract_dayofyear , subq_0.listing__created_at__day , 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.listing__created_at__extract_year + , subq_0.listing__created_at__extract_quarter + , subq_0.listing__created_at__extract_month + , subq_0.listing__created_at__extract_week + , subq_0.listing__created_at__extract_day + , subq_0.listing__created_at__extract_dayofweek + , subq_0.listing__created_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -77,11 +119,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql index 316737d00a..b05da97264 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql @@ -35,32 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql index 73e6a70d92..437dc887b4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql @@ -60,31 +60,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -134,32 +176,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -184,21 +268,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -227,11 +339,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -240,11 +366,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -317,31 +457,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -391,32 +573,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -441,21 +665,49 @@ FROM ( , subq_15.ds__month , subq_15.ds__quarter , subq_15.ds__year + , subq_15.ds__extract_year + , subq_15.ds__extract_quarter + , subq_15.ds__extract_month + , subq_15.ds__extract_week + , subq_15.ds__extract_day + , subq_15.ds__extract_dayofweek + , subq_15.ds__extract_dayofyear , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month , subq_15.created_at__quarter , subq_15.created_at__year + , subq_15.created_at__extract_year + , subq_15.created_at__extract_quarter + , subq_15.created_at__extract_month + , subq_15.created_at__extract_week + , subq_15.created_at__extract_day + , subq_15.created_at__extract_dayofweek + , subq_15.created_at__extract_dayofyear , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month , subq_15.listing__ds__quarter , subq_15.listing__ds__year + , subq_15.listing__ds__extract_year + , subq_15.listing__ds__extract_quarter + , subq_15.listing__ds__extract_month + , subq_15.listing__ds__extract_week + , subq_15.listing__ds__extract_day + , subq_15.listing__ds__extract_dayofweek + , subq_15.listing__ds__extract_dayofyear , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month , subq_15.listing__created_at__quarter , subq_15.listing__created_at__year + , subq_15.listing__created_at__extract_year + , subq_15.listing__created_at__extract_quarter + , subq_15.listing__created_at__extract_month + , subq_15.listing__created_at__extract_week + , subq_15.listing__created_at__extract_day + , subq_15.listing__created_at__extract_dayofweek + , subq_15.listing__created_at__extract_dayofyear , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -484,11 +736,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -497,11 +763,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -557,31 +837,73 @@ FROM ( , subq_24.ds__month , subq_24.ds__quarter , subq_24.ds__year + , subq_24.ds__extract_year + , subq_24.ds__extract_quarter + , subq_24.ds__extract_month + , subq_24.ds__extract_week + , subq_24.ds__extract_day + , subq_24.ds__extract_dayofweek + , subq_24.ds__extract_dayofyear , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month , subq_24.ds_partitioned__quarter , subq_24.ds_partitioned__year + , subq_24.ds_partitioned__extract_year + , subq_24.ds_partitioned__extract_quarter + , subq_24.ds_partitioned__extract_month + , subq_24.ds_partitioned__extract_week + , subq_24.ds_partitioned__extract_day + , subq_24.ds_partitioned__extract_dayofweek + , subq_24.ds_partitioned__extract_dayofyear , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month , subq_24.paid_at__quarter , subq_24.paid_at__year + , subq_24.paid_at__extract_year + , subq_24.paid_at__extract_quarter + , subq_24.paid_at__extract_month + , subq_24.paid_at__extract_week + , subq_24.paid_at__extract_day + , subq_24.paid_at__extract_dayofweek + , subq_24.paid_at__extract_dayofyear , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month , subq_24.booking__ds__quarter , subq_24.booking__ds__year + , subq_24.booking__ds__extract_year + , subq_24.booking__ds__extract_quarter + , subq_24.booking__ds__extract_month + , subq_24.booking__ds__extract_week + , subq_24.booking__ds__extract_day + , subq_24.booking__ds__extract_dayofweek + , subq_24.booking__ds__extract_dayofyear , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month , subq_24.booking__ds_partitioned__quarter , subq_24.booking__ds_partitioned__year + , subq_24.booking__ds_partitioned__extract_year + , subq_24.booking__ds_partitioned__extract_quarter + , subq_24.booking__ds_partitioned__extract_month + , subq_24.booking__ds_partitioned__extract_week + , subq_24.booking__ds_partitioned__extract_day + , subq_24.booking__ds_partitioned__extract_dayofweek + , subq_24.booking__ds_partitioned__extract_dayofyear , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month , subq_24.booking__paid_at__quarter , subq_24.booking__paid_at__year + , subq_24.booking__paid_at__extract_year + , subq_24.booking__paid_at__extract_quarter + , subq_24.booking__paid_at__extract_month + , subq_24.booking__paid_at__extract_week + , subq_24.booking__paid_at__extract_day + , subq_24.booking__paid_at__extract_dayofweek + , subq_24.booking__paid_at__extract_dayofyear , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -631,32 +953,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql index f951333a58..9626242169 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql @@ -45,31 +45,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,32 +161,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -186,31 +270,73 @@ FROM ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month , subq_7.ds_partitioned__quarter , subq_7.ds_partitioned__year + , subq_7.ds_partitioned__extract_year + , subq_7.ds_partitioned__extract_quarter + , subq_7.ds_partitioned__extract_month + , subq_7.ds_partitioned__extract_week + , subq_7.ds_partitioned__extract_day + , subq_7.ds_partitioned__extract_dayofweek + , subq_7.ds_partitioned__extract_dayofyear , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month , subq_7.paid_at__quarter , subq_7.paid_at__year + , subq_7.paid_at__extract_year + , subq_7.paid_at__extract_quarter + , subq_7.paid_at__extract_month + , subq_7.paid_at__extract_week + , subq_7.paid_at__extract_day + , subq_7.paid_at__extract_dayofweek + , subq_7.paid_at__extract_dayofyear , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month , subq_7.booking__ds__quarter , subq_7.booking__ds__year + , subq_7.booking__ds__extract_year + , subq_7.booking__ds__extract_quarter + , subq_7.booking__ds__extract_month + , subq_7.booking__ds__extract_week + , subq_7.booking__ds__extract_day + , subq_7.booking__ds__extract_dayofweek + , subq_7.booking__ds__extract_dayofyear , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month , subq_7.booking__ds_partitioned__quarter , subq_7.booking__ds_partitioned__year + , subq_7.booking__ds_partitioned__extract_year + , subq_7.booking__ds_partitioned__extract_quarter + , subq_7.booking__ds_partitioned__extract_month + , subq_7.booking__ds_partitioned__extract_week + , subq_7.booking__ds_partitioned__extract_day + , subq_7.booking__ds_partitioned__extract_dayofweek + , subq_7.booking__ds_partitioned__extract_dayofyear , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month , subq_7.booking__paid_at__quarter , subq_7.booking__paid_at__year + , subq_7.booking__paid_at__extract_year + , subq_7.booking__paid_at__extract_quarter + , subq_7.booking__paid_at__extract_month + , subq_7.booking__paid_at__extract_week + , subq_7.booking__paid_at__extract_day + , subq_7.booking__paid_at__extract_dayofweek + , subq_7.booking__paid_at__extract_dayofyear , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -260,32 +386,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 13d80a91d0..a495423238 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -39,31 +39,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -113,32 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index e05efe9cf1..c868e3cfd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -160,21 +244,49 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month , subq_5.created_at__quarter , subq_5.created_at__year + , subq_5.created_at__extract_year + , subq_5.created_at__extract_quarter + , subq_5.created_at__extract_month + , subq_5.created_at__extract_week + , subq_5.created_at__extract_day + , subq_5.created_at__extract_dayofweek + , subq_5.created_at__extract_dayofyear , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month , subq_5.listing__ds__quarter , subq_5.listing__ds__year + , subq_5.listing__ds__extract_year + , subq_5.listing__ds__extract_quarter + , subq_5.listing__ds__extract_month + , subq_5.listing__ds__extract_week + , subq_5.listing__ds__extract_day + , subq_5.listing__ds__extract_dayofweek + , subq_5.listing__ds__extract_dayofyear , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month , subq_5.listing__created_at__quarter , subq_5.listing__created_at__year + , subq_5.listing__created_at__extract_year + , subq_5.listing__created_at__extract_quarter + , subq_5.listing__created_at__extract_month + , subq_5.listing__created_at__extract_week + , subq_5.listing__created_at__extract_day + , subq_5.listing__created_at__extract_dayofweek + , subq_5.listing__created_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -203,11 +315,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -216,11 +342,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql index 88cc0b431d..760a9d333e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__day AS listing__window_start__day + , subq_7.window_start__extract_week AS listing__window_start__extract_week , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -142,7 +226,7 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__day + subq_6.window_start__extract_week , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest @@ -154,26 +238,61 @@ FROM ( , subq_3.window_start__month AS window_start__month , subq_3.window_start__quarter AS window_start__quarter , subq_3.window_start__year AS window_start__year + , subq_3.window_start__extract_year AS window_start__extract_year + , subq_3.window_start__extract_quarter AS window_start__extract_quarter + , subq_3.window_start__extract_month AS window_start__extract_month + , subq_3.window_start__extract_week AS window_start__extract_week + , subq_3.window_start__extract_day AS window_start__extract_day + , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek + , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month , subq_3.window_end__quarter AS window_end__quarter , subq_3.window_end__year AS window_end__year + , subq_3.window_end__extract_year AS window_end__extract_year + , subq_3.window_end__extract_quarter AS window_end__extract_quarter + , subq_3.window_end__extract_month AS window_end__extract_month + , subq_3.window_end__extract_week AS window_end__extract_week + , subq_3.window_end__extract_day AS window_end__extract_day + , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek + , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month , subq_3.listing__window_start__quarter AS listing__window_start__quarter , subq_3.listing__window_start__year AS listing__window_start__year + , subq_3.listing__window_start__extract_year AS listing__window_start__extract_year + , subq_3.listing__window_start__extract_quarter AS listing__window_start__extract_quarter + , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month + , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week + , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day + , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek + , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month , subq_3.listing__window_end__quarter AS listing__window_end__quarter , subq_3.listing__window_end__year AS listing__window_end__year + , subq_3.listing__window_end__extract_year AS listing__window_end__extract_year + , subq_3.listing__window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month + , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week + , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day + , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month , subq_5.ds__quarter AS user__ds__quarter , subq_5.ds__year AS user__ds__year + , subq_5.ds__extract_year AS user__ds__extract_year + , subq_5.ds__extract_quarter AS user__ds__extract_quarter + , subq_5.ds__extract_month AS user__ds__extract_month + , subq_5.ds__extract_week AS user__ds__extract_week + , subq_5.ds__extract_day AS user__ds__extract_day + , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek + , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -192,11 +311,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -205,11 +338,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -227,11 +374,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', -- 'user'] SELECT subq_4.ds__day @@ -239,11 +400,25 @@ FROM ( , subq_4.ds__month , subq_4.ds__quarter , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_week + , subq_4.ds__extract_day + , subq_4.ds__extract_dayofweek + , subq_4.ds__extract_dayofyear , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month , subq_4.user__ds__quarter , subq_4.user__ds__year + , subq_4.user__ds__extract_year + , subq_4.user__ds__extract_quarter + , subq_4.user__ds__extract_month + , subq_4.user__ds__extract_week + , subq_4.user__ds__extract_day + , subq_4.user__ds__extract_dayofweek + , subq_4.user__ds__extract_dayofyear , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -255,12 +430,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 @@ -275,7 +464,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__day + subq_2.metric_time__day >= subq_7.window_start__extract_week ) AND ( ( subq_2.metric_time__day < subq_7.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql index feb5ed0fdc..579c5ff3a6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,7 +23,7 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day + EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest @@ -38,7 +38,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__day + subq_13.metric_time__day >= subq_18.window_start__extract_week ) AND ( ( subq_13.metric_time__day < subq_18.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql index 94054a124c..138a7d9525 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day + , subq_7.lux_listing__window_start__extract_dayofweek AS listing__lux_listing__window_start__extract_dayofweek + , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -145,8 +229,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__day + subq_6.lux_listing__window_start__extract_dayofweek + , subq_6.lux_listing__window_end__extract_month , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -157,11 +241,25 @@ FROM ( , subq_5.window_start__month AS lux_listing__window_start__month , subq_5.window_start__quarter AS lux_listing__window_start__quarter , subq_5.window_start__year AS lux_listing__window_start__year + , subq_5.window_start__extract_year AS lux_listing__window_start__extract_year + , subq_5.window_start__extract_quarter AS lux_listing__window_start__extract_quarter + , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month + , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week + , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day + , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek + , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month , subq_5.window_end__quarter AS lux_listing__window_end__quarter , subq_5.window_end__year AS lux_listing__window_end__year + , subq_5.window_end__extract_year AS lux_listing__window_end__extract_year + , subq_5.window_end__extract_quarter AS lux_listing__window_end__extract_quarter + , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month + , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week + , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day + , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek + , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -183,21 +281,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -205,21 +331,49 @@ FROM ( , subq_4.window_start__month , subq_4.window_start__quarter , subq_4.window_start__year + , subq_4.window_start__extract_year + , subq_4.window_start__extract_quarter + , subq_4.window_start__extract_month + , subq_4.window_start__extract_week + , subq_4.window_start__extract_day + , subq_4.window_start__extract_dayofweek + , subq_4.window_start__extract_dayofyear , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month , subq_4.window_end__quarter , subq_4.window_end__year + , subq_4.window_end__extract_year + , subq_4.window_end__extract_quarter + , subq_4.window_end__extract_month + , subq_4.window_end__extract_week + , subq_4.window_end__extract_day + , subq_4.window_end__extract_dayofweek + , subq_4.window_end__extract_dayofyear , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month , subq_4.lux_listing__window_start__quarter , subq_4.lux_listing__window_start__year + , subq_4.lux_listing__window_start__extract_year + , subq_4.lux_listing__window_start__extract_quarter + , subq_4.lux_listing__window_start__extract_month + , subq_4.lux_listing__window_start__extract_week + , subq_4.lux_listing__window_start__extract_day + , subq_4.lux_listing__window_start__extract_dayofweek + , subq_4.lux_listing__window_start__extract_dayofyear , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month , subq_4.lux_listing__window_end__quarter , subq_4.lux_listing__window_end__year + , subq_4.lux_listing__window_end__extract_year + , subq_4.lux_listing__window_end__extract_quarter + , subq_4.lux_listing__window_end__extract_month + , subq_4.lux_listing__window_end__extract_week + , subq_4.lux_listing__window_end__extract_day + , subq_4.lux_listing__window_end__extract_dayofweek + , subq_4.lux_listing__window_end__extract_dayofyear , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -231,22 +385,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 @@ -261,12 +443,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofweek ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__day + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month ) OR ( - subq_7.lux_listing__window_end__day IS NULL + subq_7.lux_listing__window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql index f1b419a284..aca1260a66 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day + EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofweek ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__day + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month ) OR ( - subq_18.lux_listing__window_end__day IS NULL + subq_18.lux_listing__window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql index ae8b7838b7..cb9670f074 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql @@ -33,32 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -85,11 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -98,11 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -131,11 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -144,11 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql index d35179ebf0..fbddd59f54 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.account_id__ds_partitioned__day , 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_partitioned__extract_year + , subq_0.account_id__ds_partitioned__extract_quarter + , subq_0.account_id__ds_partitioned__extract_month + , subq_0.account_id__ds_partitioned__extract_week + , subq_0.account_id__ds_partitioned__extract_day + , subq_0.account_id__ds_partitioned__extract_dayofweek + , subq_0.account_id__ds_partitioned__extract_dayofyear , subq_0.account_id__ds__day , 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.account_id__ds__extract_year + , subq_0.account_id__ds__extract_quarter + , subq_0.account_id__ds__extract_month + , subq_0.account_id__ds__extract_week + , subq_0.account_id__ds__extract_day + , subq_0.account_id__ds__extract_dayofweek + , subq_0.account_id__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -69,22 +97,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -106,16 +162,37 @@ FROM ( , 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.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_3.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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_3.account_id__ds_partitioned__extract_year AS account_id__ds_partitioned__extract_year + , subq_3.account_id__ds_partitioned__extract_quarter AS account_id__ds_partitioned__extract_quarter + , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month + , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week + , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day + , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek + , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , 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_5.ds_partitioned__extract_year AS customer_id__ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter AS customer_id__ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear , 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 @@ -132,12 +209,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -154,11 +245,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -166,11 +271,25 @@ FROM ( , subq_4.ds_partitioned__month , subq_4.ds_partitioned__quarter , subq_4.ds_partitioned__year + , subq_4.ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear , subq_4.customer_id__ds_partitioned__day , 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__ds_partitioned__extract_year + , subq_4.customer_id__ds_partitioned__extract_quarter + , subq_4.customer_id__ds_partitioned__extract_month + , subq_4.customer_id__ds_partitioned__extract_week + , subq_4.customer_id__ds_partitioned__extract_day + , subq_4.customer_id__ds_partitioned__extract_dayofweek + , subq_4.customer_id__ds_partitioned__extract_dayofyear , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -186,6 +305,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -193,6 +319,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql index 5c9089deaf..eb31a4fb3a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql @@ -23,31 +23,73 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month , subq_1.ds_partitioned__quarter , subq_1.ds_partitioned__year + , subq_1.ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month , subq_1.paid_at__quarter , subq_1.paid_at__year + , subq_1.paid_at__extract_year + , subq_1.paid_at__extract_quarter + , subq_1.paid_at__extract_month + , subq_1.paid_at__extract_week + , subq_1.paid_at__extract_day + , subq_1.paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month , subq_1.booking__ds__quarter , subq_1.booking__ds__year + , subq_1.booking__ds__extract_year + , subq_1.booking__ds__extract_quarter + , subq_1.booking__ds__extract_month + , subq_1.booking__ds__extract_week + , subq_1.booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month , subq_1.booking__paid_at__quarter , subq_1.booking__paid_at__year + , subq_1.booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -82,31 +124,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -156,32 +240,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -217,21 +343,49 @@ CROSS JOIN ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month , subq_7.created_at__quarter , subq_7.created_at__year + , subq_7.created_at__extract_year + , subq_7.created_at__extract_quarter + , subq_7.created_at__extract_month + , subq_7.created_at__extract_week + , subq_7.created_at__extract_day + , subq_7.created_at__extract_dayofweek + , subq_7.created_at__extract_dayofyear , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month , subq_7.listing__ds__quarter , subq_7.listing__ds__year + , subq_7.listing__ds__extract_year + , subq_7.listing__ds__extract_quarter + , subq_7.listing__ds__extract_month + , subq_7.listing__ds__extract_week + , subq_7.listing__ds__extract_day + , subq_7.listing__ds__extract_dayofweek + , subq_7.listing__ds__extract_dayofyear , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month , subq_7.listing__created_at__quarter , subq_7.listing__created_at__year + , subq_7.listing__created_at__extract_year + , subq_7.listing__created_at__extract_quarter + , subq_7.listing__created_at__extract_month + , subq_7.listing__created_at__extract_week + , subq_7.listing__created_at__extract_day + , subq_7.listing__created_at__extract_dayofweek + , subq_7.listing__created_at__extract_dayofyear , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -257,21 +411,49 @@ CROSS JOIN ( , subq_6.ds__month , subq_6.ds__quarter , subq_6.ds__year + , subq_6.ds__extract_year + , subq_6.ds__extract_quarter + , subq_6.ds__extract_month + , subq_6.ds__extract_week + , subq_6.ds__extract_day + , subq_6.ds__extract_dayofweek + , subq_6.ds__extract_dayofyear , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month , subq_6.created_at__quarter , subq_6.created_at__year + , subq_6.created_at__extract_year + , subq_6.created_at__extract_quarter + , subq_6.created_at__extract_month + , subq_6.created_at__extract_week + , subq_6.created_at__extract_day + , subq_6.created_at__extract_dayofweek + , subq_6.created_at__extract_dayofyear , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month , subq_6.listing__ds__quarter , subq_6.listing__ds__year + , subq_6.listing__ds__extract_year + , subq_6.listing__ds__extract_quarter + , subq_6.listing__ds__extract_month + , subq_6.listing__ds__extract_week + , subq_6.listing__ds__extract_day + , subq_6.listing__ds__extract_dayofweek + , subq_6.listing__ds__extract_dayofyear , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month , subq_6.listing__created_at__quarter , subq_6.listing__created_at__year + , subq_6.listing__created_at__extract_year + , subq_6.listing__created_at__extract_quarter + , subq_6.listing__created_at__extract_month + , subq_6.listing__created_at__extract_week + , subq_6.listing__created_at__extract_day + , subq_6.listing__created_at__extract_dayofweek + , subq_6.listing__created_at__extract_dayofyear , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -300,11 +482,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -313,11 +509,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql index 14a9f0385a..dc0afd0f09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql @@ -44,31 +44,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -118,32 +160,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -182,31 +266,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -256,32 +382,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,31 +500,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -406,32 +616,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -480,31 +732,73 @@ FROM ( , subq_17.ds__month , subq_17.ds__quarter , subq_17.ds__year + , subq_17.ds__extract_year + , subq_17.ds__extract_quarter + , subq_17.ds__extract_month + , subq_17.ds__extract_week + , subq_17.ds__extract_day + , subq_17.ds__extract_dayofweek + , subq_17.ds__extract_dayofyear , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month , subq_17.ds_partitioned__quarter , subq_17.ds_partitioned__year + , subq_17.ds_partitioned__extract_year + , subq_17.ds_partitioned__extract_quarter + , subq_17.ds_partitioned__extract_month + , subq_17.ds_partitioned__extract_week + , subq_17.ds_partitioned__extract_day + , subq_17.ds_partitioned__extract_dayofweek + , subq_17.ds_partitioned__extract_dayofyear , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month , subq_17.paid_at__quarter , subq_17.paid_at__year + , subq_17.paid_at__extract_year + , subq_17.paid_at__extract_quarter + , subq_17.paid_at__extract_month + , subq_17.paid_at__extract_week + , subq_17.paid_at__extract_day + , subq_17.paid_at__extract_dayofweek + , subq_17.paid_at__extract_dayofyear , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month , subq_17.booking__ds__quarter , subq_17.booking__ds__year + , subq_17.booking__ds__extract_year + , subq_17.booking__ds__extract_quarter + , subq_17.booking__ds__extract_month + , subq_17.booking__ds__extract_week + , subq_17.booking__ds__extract_day + , subq_17.booking__ds__extract_dayofweek + , subq_17.booking__ds__extract_dayofyear , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month , subq_17.booking__ds_partitioned__quarter , subq_17.booking__ds_partitioned__year + , subq_17.booking__ds_partitioned__extract_year + , subq_17.booking__ds_partitioned__extract_quarter + , subq_17.booking__ds_partitioned__extract_month + , subq_17.booking__ds_partitioned__extract_week + , subq_17.booking__ds_partitioned__extract_day + , subq_17.booking__ds_partitioned__extract_dayofweek + , subq_17.booking__ds_partitioned__extract_dayofyear , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month , subq_17.booking__paid_at__quarter , subq_17.booking__paid_at__year + , subq_17.booking__paid_at__extract_year + , subq_17.booking__paid_at__extract_quarter + , subq_17.booking__paid_at__extract_month + , subq_17.booking__paid_at__extract_week + , subq_17.booking__paid_at__extract_day + , subq_17.booking__paid_at__extract_dayofweek + , subq_17.booking__paid_at__extract_dayofyear , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -554,32 +848,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql index be96decab5..63116a5458 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql @@ -45,32 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql index a5288e7009..a53f3a075b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month , subq_0.verification__ds__quarter , subq_0.verification__ds__year + , subq_0.verification__ds__extract_year + , subq_0.verification__ds__extract_quarter + , subq_0.verification__ds__extract_month + , subq_0.verification__ds__extract_week + , subq_0.verification__ds__extract_day + , subq_0.verification__ds__extract_dayofweek + , subq_0.verification__ds__extract_dayofyear , subq_0.verification__ds_partitioned__day , 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.verification__ds_partitioned__extract_year + , subq_0.verification__ds_partitioned__extract_quarter + , subq_0.verification__ds_partitioned__extract_month + , subq_0.verification__ds_partitioned__extract_week + , subq_0.verification__ds_partitioned__extract_day + , subq_0.verification__ds_partitioned__extract_dayofweek + , subq_0.verification__ds_partitioned__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -71,22 +99,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -110,32 +166,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql index c65a58a300..d88d2d32f3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -54,12 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql index 603dac8609..094486f462 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql index adfa1c3f03..a8a26c9899 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 48a1b43de5..c400372dd4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 08a913aa57..30ab4c1851 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ed796b148d..ef337f422c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql index 782ccc2826..16b897731d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -83,11 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -96,11 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql index 0f449eb59e..7dd5c3b39d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql index ee19129508..e240956212 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql index 214766cb17..073c7964da 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -239,32 +365,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql index 63637a9433..c80b16baf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index f9ef4e1727..5f9a321abd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -51,31 +51,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,32 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -175,21 +259,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -218,11 +330,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -231,11 +357,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -296,21 +436,49 @@ FROM ( , subq_10.ds__month , subq_10.ds__quarter , subq_10.ds__year + , subq_10.ds__extract_year + , subq_10.ds__extract_quarter + , subq_10.ds__extract_month + , subq_10.ds__extract_week + , subq_10.ds__extract_day + , subq_10.ds__extract_dayofweek + , subq_10.ds__extract_dayofyear , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month , subq_10.ds_partitioned__quarter , subq_10.ds_partitioned__year + , subq_10.ds_partitioned__extract_year + , subq_10.ds_partitioned__extract_quarter + , subq_10.ds_partitioned__extract_month + , subq_10.ds_partitioned__extract_week + , subq_10.ds_partitioned__extract_day + , subq_10.ds_partitioned__extract_dayofweek + , subq_10.ds_partitioned__extract_dayofyear , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month , subq_10.view__ds__quarter , subq_10.view__ds__year + , subq_10.view__ds__extract_year + , subq_10.view__ds__extract_quarter + , subq_10.view__ds__extract_month + , subq_10.view__ds__extract_week + , subq_10.view__ds__extract_day + , subq_10.view__ds__extract_dayofweek + , subq_10.view__ds__extract_dayofyear , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month , subq_10.view__ds_partitioned__quarter , subq_10.view__ds_partitioned__year + , subq_10.view__ds_partitioned__extract_year + , subq_10.view__ds_partitioned__extract_quarter + , subq_10.view__ds_partitioned__extract_month + , subq_10.view__ds_partitioned__extract_week + , subq_10.view__ds_partitioned__extract_day + , subq_10.view__ds_partitioned__extract_dayofweek + , subq_10.view__ds_partitioned__extract_dayofyear , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -330,21 +498,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -367,21 +563,49 @@ FROM ( , subq_13.ds__month , subq_13.ds__quarter , subq_13.ds__year + , subq_13.ds__extract_year + , subq_13.ds__extract_quarter + , subq_13.ds__extract_month + , subq_13.ds__extract_week + , subq_13.ds__extract_day + , subq_13.ds__extract_dayofweek + , subq_13.ds__extract_dayofyear , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month , subq_13.created_at__quarter , subq_13.created_at__year + , subq_13.created_at__extract_year + , subq_13.created_at__extract_quarter + , subq_13.created_at__extract_month + , subq_13.created_at__extract_week + , subq_13.created_at__extract_day + , subq_13.created_at__extract_dayofweek + , subq_13.created_at__extract_dayofyear , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month , subq_13.listing__ds__quarter , subq_13.listing__ds__year + , subq_13.listing__ds__extract_year + , subq_13.listing__ds__extract_quarter + , subq_13.listing__ds__extract_month + , subq_13.listing__ds__extract_week + , subq_13.listing__ds__extract_day + , subq_13.listing__ds__extract_dayofweek + , subq_13.listing__ds__extract_dayofyear , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month , subq_13.listing__created_at__quarter , subq_13.listing__created_at__year + , subq_13.listing__created_at__extract_year + , subq_13.listing__created_at__extract_quarter + , subq_13.listing__created_at__extract_month + , subq_13.listing__created_at__extract_week + , subq_13.listing__created_at__extract_day + , subq_13.listing__created_at__extract_dayofweek + , subq_13.listing__created_at__extract_dayofyear , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -410,11 +634,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -423,11 +661,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index e424fa31af..b2d5615477 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,32 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -99,11 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -112,11 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql index 48583b238a..b6f01861d7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql index 4ca35f2544..d480357663 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql @@ -38,32 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql index b515ad2da5..f52c8d6acf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql index 5eb893b84a..4e79154b70 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql index 2393630095..f44071348d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql @@ -18,11 +18,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -40,11 +54,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql index 9ced88e0cc..4c321e73b0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index dd00d2b15e..4821d797fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql index 658dcf3357..2a39c9282f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql index 9bafb5e1f6..82ded0a878 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -170,31 +254,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -244,32 +370,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql index edbbe545fd..f21c6e33a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index c97b8fd930..34b929887f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql index 03b1c29282..44073119ae 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 6a32edb464..66bd68c2c6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index d52164ec94..9ab70d9a6a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -235,31 +361,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -295,31 +463,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -369,32 +579,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 1a2a3259ba..34b0e577f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -236,31 +362,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -296,31 +464,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -370,32 +580,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql index edd3eef59c..390f041085 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter , subq_4.ds__year AS ds__year + , subq_4.ds__extract_year AS ds__extract_year + , subq_4.ds__extract_quarter AS ds__extract_quarter + , subq_4.ds__extract_month AS ds__extract_month + , subq_4.ds__extract_week AS ds__extract_week + , subq_4.ds__extract_day AS ds__extract_day + , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month , subq_4.ds_partitioned__quarter AS ds_partitioned__quarter , subq_4.ds_partitioned__year AS ds_partitioned__year + , subq_4.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month , subq_4.paid_at__quarter AS paid_at__quarter , subq_4.paid_at__year AS paid_at__year + , subq_4.paid_at__extract_year AS paid_at__extract_year + , subq_4.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_4.paid_at__extract_month AS paid_at__extract_month + , subq_4.paid_at__extract_week AS paid_at__extract_week + , subq_4.paid_at__extract_day AS paid_at__extract_day + , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month , subq_4.booking__ds__quarter AS booking__ds__quarter , subq_4.booking__ds__year AS booking__ds__year + , subq_4.booking__ds__extract_year AS booking__ds__extract_year + , subq_4.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_4.booking__ds__extract_month AS booking__ds__extract_month + , subq_4.booking__ds__extract_week AS booking__ds__extract_week + , subq_4.booking__ds__extract_day AS booking__ds__extract_day + , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_4.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_4.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_4.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_4.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month , subq_4.booking__paid_at__quarter AS booking__paid_at__quarter , subq_4.booking__paid_at__year AS booking__paid_at__year + , subq_4.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_4.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -88,31 +130,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -152,31 +236,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -226,32 +352,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql index 26c360ab9e..3c8d87a17b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -87,31 +129,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -161,32 +245,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql index 870b2c80ea..3adff18e62 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql @@ -42,31 +42,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,32 +158,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -166,21 +250,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -209,11 +321,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -222,11 +348,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql index ddba65921c..00efad0383 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql @@ -25,32 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql index 7ce1a71c7f..7e0fdff19e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql index 81e6d39ada..eb70f04221 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -48,31 +48,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,32 +164,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -172,21 +256,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -215,11 +327,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -228,11 +354,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql index 4caa3d07f0..246522e063 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__day AS listing__window_end__day + , subq_4.window_start__extract_month AS listing__window_start__extract_month + , subq_4.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -50,31 +50,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -110,32 +152,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -152,8 +236,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__day - , subq_3.window_end__day + subq_3.window_start__extract_month + , subq_3.window_end__extract_dayofweek , subq_3.listing , subq_3.capacity FROM ( @@ -164,11 +248,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -177,11 +275,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -196,12 +308,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__day + subq_2.metric_time__day >= subq_4.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__day + subq_2.metric_time__day < subq_4.window_end__extract_dayofweek ) OR ( - subq_4.window_end__day IS NULL + subq_4.window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql index 86a2010b35..710e67b149 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) ) OR ( - listings_src_10017.active_to IS NULL + EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ed1bd4e99..6ef8853985 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql index 22702f0c48..29fb5d972e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql index 027f20ea5b..16e8afe8d0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql index 913fed793c..b00d690648 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql @@ -26,31 +26,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql index 86b30c4553..583b4a4bf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql @@ -21,21 +21,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month , subq_0.created_at__quarter , subq_0.created_at__year + , subq_0.created_at__extract_year + , subq_0.created_at__extract_quarter + , subq_0.created_at__extract_month + , subq_0.created_at__extract_week + , subq_0.created_at__extract_day + , subq_0.created_at__extract_dayofweek + , subq_0.created_at__extract_dayofyear , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month , subq_0.listing__ds__quarter , subq_0.listing__ds__year + , subq_0.listing__ds__extract_year + , subq_0.listing__ds__extract_quarter + , subq_0.listing__ds__extract_month + , subq_0.listing__ds__extract_week + , subq_0.listing__ds__extract_day + , subq_0.listing__ds__extract_dayofweek + , subq_0.listing__ds__extract_dayofyear , subq_0.listing__created_at__day , 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.listing__created_at__extract_year + , subq_0.listing__created_at__extract_quarter + , subq_0.listing__created_at__extract_month + , subq_0.listing__created_at__extract_week + , subq_0.listing__created_at__extract_day + , subq_0.listing__created_at__extract_dayofweek + , subq_0.listing__created_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -77,11 +119,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql index 316737d00a..b05da97264 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql @@ -35,32 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql index 73e6a70d92..437dc887b4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql @@ -60,31 +60,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -134,32 +176,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -184,21 +268,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -227,11 +339,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -240,11 +366,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -317,31 +457,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -391,32 +573,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -441,21 +665,49 @@ FROM ( , subq_15.ds__month , subq_15.ds__quarter , subq_15.ds__year + , subq_15.ds__extract_year + , subq_15.ds__extract_quarter + , subq_15.ds__extract_month + , subq_15.ds__extract_week + , subq_15.ds__extract_day + , subq_15.ds__extract_dayofweek + , subq_15.ds__extract_dayofyear , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month , subq_15.created_at__quarter , subq_15.created_at__year + , subq_15.created_at__extract_year + , subq_15.created_at__extract_quarter + , subq_15.created_at__extract_month + , subq_15.created_at__extract_week + , subq_15.created_at__extract_day + , subq_15.created_at__extract_dayofweek + , subq_15.created_at__extract_dayofyear , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month , subq_15.listing__ds__quarter , subq_15.listing__ds__year + , subq_15.listing__ds__extract_year + , subq_15.listing__ds__extract_quarter + , subq_15.listing__ds__extract_month + , subq_15.listing__ds__extract_week + , subq_15.listing__ds__extract_day + , subq_15.listing__ds__extract_dayofweek + , subq_15.listing__ds__extract_dayofyear , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month , subq_15.listing__created_at__quarter , subq_15.listing__created_at__year + , subq_15.listing__created_at__extract_year + , subq_15.listing__created_at__extract_quarter + , subq_15.listing__created_at__extract_month + , subq_15.listing__created_at__extract_week + , subq_15.listing__created_at__extract_day + , subq_15.listing__created_at__extract_dayofweek + , subq_15.listing__created_at__extract_dayofyear , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -484,11 +736,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -497,11 +763,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -557,31 +837,73 @@ FROM ( , subq_24.ds__month , subq_24.ds__quarter , subq_24.ds__year + , subq_24.ds__extract_year + , subq_24.ds__extract_quarter + , subq_24.ds__extract_month + , subq_24.ds__extract_week + , subq_24.ds__extract_day + , subq_24.ds__extract_dayofweek + , subq_24.ds__extract_dayofyear , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month , subq_24.ds_partitioned__quarter , subq_24.ds_partitioned__year + , subq_24.ds_partitioned__extract_year + , subq_24.ds_partitioned__extract_quarter + , subq_24.ds_partitioned__extract_month + , subq_24.ds_partitioned__extract_week + , subq_24.ds_partitioned__extract_day + , subq_24.ds_partitioned__extract_dayofweek + , subq_24.ds_partitioned__extract_dayofyear , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month , subq_24.paid_at__quarter , subq_24.paid_at__year + , subq_24.paid_at__extract_year + , subq_24.paid_at__extract_quarter + , subq_24.paid_at__extract_month + , subq_24.paid_at__extract_week + , subq_24.paid_at__extract_day + , subq_24.paid_at__extract_dayofweek + , subq_24.paid_at__extract_dayofyear , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month , subq_24.booking__ds__quarter , subq_24.booking__ds__year + , subq_24.booking__ds__extract_year + , subq_24.booking__ds__extract_quarter + , subq_24.booking__ds__extract_month + , subq_24.booking__ds__extract_week + , subq_24.booking__ds__extract_day + , subq_24.booking__ds__extract_dayofweek + , subq_24.booking__ds__extract_dayofyear , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month , subq_24.booking__ds_partitioned__quarter , subq_24.booking__ds_partitioned__year + , subq_24.booking__ds_partitioned__extract_year + , subq_24.booking__ds_partitioned__extract_quarter + , subq_24.booking__ds_partitioned__extract_month + , subq_24.booking__ds_partitioned__extract_week + , subq_24.booking__ds_partitioned__extract_day + , subq_24.booking__ds_partitioned__extract_dayofweek + , subq_24.booking__ds_partitioned__extract_dayofyear , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month , subq_24.booking__paid_at__quarter , subq_24.booking__paid_at__year + , subq_24.booking__paid_at__extract_year + , subq_24.booking__paid_at__extract_quarter + , subq_24.booking__paid_at__extract_month + , subq_24.booking__paid_at__extract_week + , subq_24.booking__paid_at__extract_day + , subq_24.booking__paid_at__extract_dayofweek + , subq_24.booking__paid_at__extract_dayofyear , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -631,32 +953,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql index f951333a58..9626242169 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql @@ -45,31 +45,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,32 +161,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -186,31 +270,73 @@ FROM ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month , subq_7.ds_partitioned__quarter , subq_7.ds_partitioned__year + , subq_7.ds_partitioned__extract_year + , subq_7.ds_partitioned__extract_quarter + , subq_7.ds_partitioned__extract_month + , subq_7.ds_partitioned__extract_week + , subq_7.ds_partitioned__extract_day + , subq_7.ds_partitioned__extract_dayofweek + , subq_7.ds_partitioned__extract_dayofyear , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month , subq_7.paid_at__quarter , subq_7.paid_at__year + , subq_7.paid_at__extract_year + , subq_7.paid_at__extract_quarter + , subq_7.paid_at__extract_month + , subq_7.paid_at__extract_week + , subq_7.paid_at__extract_day + , subq_7.paid_at__extract_dayofweek + , subq_7.paid_at__extract_dayofyear , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month , subq_7.booking__ds__quarter , subq_7.booking__ds__year + , subq_7.booking__ds__extract_year + , subq_7.booking__ds__extract_quarter + , subq_7.booking__ds__extract_month + , subq_7.booking__ds__extract_week + , subq_7.booking__ds__extract_day + , subq_7.booking__ds__extract_dayofweek + , subq_7.booking__ds__extract_dayofyear , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month , subq_7.booking__ds_partitioned__quarter , subq_7.booking__ds_partitioned__year + , subq_7.booking__ds_partitioned__extract_year + , subq_7.booking__ds_partitioned__extract_quarter + , subq_7.booking__ds_partitioned__extract_month + , subq_7.booking__ds_partitioned__extract_week + , subq_7.booking__ds_partitioned__extract_day + , subq_7.booking__ds_partitioned__extract_dayofweek + , subq_7.booking__ds_partitioned__extract_dayofyear , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month , subq_7.booking__paid_at__quarter , subq_7.booking__paid_at__year + , subq_7.booking__paid_at__extract_year + , subq_7.booking__paid_at__extract_quarter + , subq_7.booking__paid_at__extract_month + , subq_7.booking__paid_at__extract_week + , subq_7.booking__paid_at__extract_day + , subq_7.booking__paid_at__extract_dayofweek + , subq_7.booking__paid_at__extract_dayofyear , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -260,32 +386,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 13d80a91d0..a495423238 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -39,31 +39,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -113,32 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index e05efe9cf1..c868e3cfd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -160,21 +244,49 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month , subq_5.created_at__quarter , subq_5.created_at__year + , subq_5.created_at__extract_year + , subq_5.created_at__extract_quarter + , subq_5.created_at__extract_month + , subq_5.created_at__extract_week + , subq_5.created_at__extract_day + , subq_5.created_at__extract_dayofweek + , subq_5.created_at__extract_dayofyear , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month , subq_5.listing__ds__quarter , subq_5.listing__ds__year + , subq_5.listing__ds__extract_year + , subq_5.listing__ds__extract_quarter + , subq_5.listing__ds__extract_month + , subq_5.listing__ds__extract_week + , subq_5.listing__ds__extract_day + , subq_5.listing__ds__extract_dayofweek + , subq_5.listing__ds__extract_dayofyear , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month , subq_5.listing__created_at__quarter , subq_5.listing__created_at__year + , subq_5.listing__created_at__extract_year + , subq_5.listing__created_at__extract_quarter + , subq_5.listing__created_at__extract_month + , subq_5.listing__created_at__extract_week + , subq_5.listing__created_at__extract_day + , subq_5.listing__created_at__extract_dayofweek + , subq_5.listing__created_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -203,11 +315,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -216,11 +342,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql index 88cc0b431d..677ba894bd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__day AS listing__window_start__day - , subq_7.window_end__day AS listing__window_end__day + , subq_7.window_start__extract_month AS listing__window_start__extract_month + , subq_7.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -142,8 +226,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__day - , subq_6.window_end__day + subq_6.window_start__extract_month + , subq_6.window_end__extract_dayofweek , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -154,26 +238,61 @@ FROM ( , subq_3.window_start__month AS window_start__month , subq_3.window_start__quarter AS window_start__quarter , subq_3.window_start__year AS window_start__year + , subq_3.window_start__extract_year AS window_start__extract_year + , subq_3.window_start__extract_quarter AS window_start__extract_quarter + , subq_3.window_start__extract_month AS window_start__extract_month + , subq_3.window_start__extract_week AS window_start__extract_week + , subq_3.window_start__extract_day AS window_start__extract_day + , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek + , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month , subq_3.window_end__quarter AS window_end__quarter , subq_3.window_end__year AS window_end__year + , subq_3.window_end__extract_year AS window_end__extract_year + , subq_3.window_end__extract_quarter AS window_end__extract_quarter + , subq_3.window_end__extract_month AS window_end__extract_month + , subq_3.window_end__extract_week AS window_end__extract_week + , subq_3.window_end__extract_day AS window_end__extract_day + , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek + , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month , subq_3.listing__window_start__quarter AS listing__window_start__quarter , subq_3.listing__window_start__year AS listing__window_start__year + , subq_3.listing__window_start__extract_year AS listing__window_start__extract_year + , subq_3.listing__window_start__extract_quarter AS listing__window_start__extract_quarter + , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month + , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week + , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day + , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek + , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month , subq_3.listing__window_end__quarter AS listing__window_end__quarter , subq_3.listing__window_end__year AS listing__window_end__year + , subq_3.listing__window_end__extract_year AS listing__window_end__extract_year + , subq_3.listing__window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month + , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week + , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day + , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month , subq_5.ds__quarter AS user__ds__quarter , subq_5.ds__year AS user__ds__year + , subq_5.ds__extract_year AS user__ds__extract_year + , subq_5.ds__extract_quarter AS user__ds__extract_quarter + , subq_5.ds__extract_month AS user__ds__extract_month + , subq_5.ds__extract_week AS user__ds__extract_week + , subq_5.ds__extract_day AS user__ds__extract_day + , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek + , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -192,11 +311,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -205,11 +338,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -227,11 +374,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', -- 'user'] SELECT subq_4.ds__day @@ -239,11 +400,25 @@ FROM ( , subq_4.ds__month , subq_4.ds__quarter , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_week + , subq_4.ds__extract_day + , subq_4.ds__extract_dayofweek + , subq_4.ds__extract_dayofyear , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month , subq_4.user__ds__quarter , subq_4.user__ds__year + , subq_4.user__ds__extract_year + , subq_4.user__ds__extract_quarter + , subq_4.user__ds__extract_month + , subq_4.user__ds__extract_week + , subq_4.user__ds__extract_day + , subq_4.user__ds__extract_dayofweek + , subq_4.user__ds__extract_dayofyear , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -255,12 +430,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 @@ -275,12 +464,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__day + subq_2.metric_time__day >= subq_7.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__day + subq_2.metric_time__day < subq_7.window_end__extract_dayofweek ) OR ( - subq_7.window_end__day IS NULL + subq_7.window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql index feb5ed0fdc..425b62e62c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day + EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__day + subq_13.metric_time__day >= subq_18.window_start__extract_month ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__day + subq_13.metric_time__day < subq_18.window_end__extract_dayofweek ) OR ( - subq_18.window_end__day IS NULL + subq_18.window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql index 94054a124c..72619bc97f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day + , subq_7.lux_listing__window_start__extract_quarter AS listing__lux_listing__window_start__extract_quarter + , subq_7.lux_listing__window_end__extract_dayofweek AS listing__lux_listing__window_end__extract_dayofweek , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -145,8 +229,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__day + subq_6.lux_listing__window_start__extract_quarter + , subq_6.lux_listing__window_end__extract_dayofweek , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -157,11 +241,25 @@ FROM ( , subq_5.window_start__month AS lux_listing__window_start__month , subq_5.window_start__quarter AS lux_listing__window_start__quarter , subq_5.window_start__year AS lux_listing__window_start__year + , subq_5.window_start__extract_year AS lux_listing__window_start__extract_year + , subq_5.window_start__extract_quarter AS lux_listing__window_start__extract_quarter + , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month + , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week + , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day + , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek + , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month , subq_5.window_end__quarter AS lux_listing__window_end__quarter , subq_5.window_end__year AS lux_listing__window_end__year + , subq_5.window_end__extract_year AS lux_listing__window_end__extract_year + , subq_5.window_end__extract_quarter AS lux_listing__window_end__extract_quarter + , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month + , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week + , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day + , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek + , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -183,21 +281,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -205,21 +331,49 @@ FROM ( , subq_4.window_start__month , subq_4.window_start__quarter , subq_4.window_start__year + , subq_4.window_start__extract_year + , subq_4.window_start__extract_quarter + , subq_4.window_start__extract_month + , subq_4.window_start__extract_week + , subq_4.window_start__extract_day + , subq_4.window_start__extract_dayofweek + , subq_4.window_start__extract_dayofyear , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month , subq_4.window_end__quarter , subq_4.window_end__year + , subq_4.window_end__extract_year + , subq_4.window_end__extract_quarter + , subq_4.window_end__extract_month + , subq_4.window_end__extract_week + , subq_4.window_end__extract_day + , subq_4.window_end__extract_dayofweek + , subq_4.window_end__extract_dayofyear , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month , subq_4.lux_listing__window_start__quarter , subq_4.lux_listing__window_start__year + , subq_4.lux_listing__window_start__extract_year + , subq_4.lux_listing__window_start__extract_quarter + , subq_4.lux_listing__window_start__extract_month + , subq_4.lux_listing__window_start__extract_week + , subq_4.lux_listing__window_start__extract_day + , subq_4.lux_listing__window_start__extract_dayofweek + , subq_4.lux_listing__window_start__extract_dayofyear , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month , subq_4.lux_listing__window_end__quarter , subq_4.lux_listing__window_end__year + , subq_4.lux_listing__window_end__extract_year + , subq_4.lux_listing__window_end__extract_quarter + , subq_4.lux_listing__window_end__extract_month + , subq_4.lux_listing__window_end__extract_week + , subq_4.lux_listing__window_end__extract_day + , subq_4.lux_listing__window_end__extract_dayofweek + , subq_4.lux_listing__window_end__extract_dayofyear , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -231,22 +385,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 @@ -261,12 +443,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_quarter ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__day + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_dayofweek ) OR ( - subq_7.lux_listing__window_end__day IS NULL + subq_7.lux_listing__window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql index f1b419a284..d0d8ae085c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day + EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_quarter ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__day + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_dayofweek ) OR ( - subq_18.lux_listing__window_end__day IS NULL + subq_18.lux_listing__window_end__extract_dayofweek IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql index ae8b7838b7..cb9670f074 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql @@ -33,32 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -85,11 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -98,11 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -131,11 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -144,11 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql index d35179ebf0..fbddd59f54 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.account_id__ds_partitioned__day , 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_partitioned__extract_year + , subq_0.account_id__ds_partitioned__extract_quarter + , subq_0.account_id__ds_partitioned__extract_month + , subq_0.account_id__ds_partitioned__extract_week + , subq_0.account_id__ds_partitioned__extract_day + , subq_0.account_id__ds_partitioned__extract_dayofweek + , subq_0.account_id__ds_partitioned__extract_dayofyear , subq_0.account_id__ds__day , 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.account_id__ds__extract_year + , subq_0.account_id__ds__extract_quarter + , subq_0.account_id__ds__extract_month + , subq_0.account_id__ds__extract_week + , subq_0.account_id__ds__extract_day + , subq_0.account_id__ds__extract_dayofweek + , subq_0.account_id__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -69,22 +97,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -106,16 +162,37 @@ FROM ( , 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.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_3.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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_3.account_id__ds_partitioned__extract_year AS account_id__ds_partitioned__extract_year + , subq_3.account_id__ds_partitioned__extract_quarter AS account_id__ds_partitioned__extract_quarter + , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month + , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week + , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day + , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek + , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , 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_5.ds_partitioned__extract_year AS customer_id__ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter AS customer_id__ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear , 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 @@ -132,12 +209,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -154,11 +245,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -166,11 +271,25 @@ FROM ( , subq_4.ds_partitioned__month , subq_4.ds_partitioned__quarter , subq_4.ds_partitioned__year + , subq_4.ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear , subq_4.customer_id__ds_partitioned__day , 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__ds_partitioned__extract_year + , subq_4.customer_id__ds_partitioned__extract_quarter + , subq_4.customer_id__ds_partitioned__extract_month + , subq_4.customer_id__ds_partitioned__extract_week + , subq_4.customer_id__ds_partitioned__extract_day + , subq_4.customer_id__ds_partitioned__extract_dayofweek + , subq_4.customer_id__ds_partitioned__extract_dayofyear , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -186,6 +305,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -193,6 +319,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql index 5c9089deaf..eb31a4fb3a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql @@ -23,31 +23,73 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month , subq_1.ds_partitioned__quarter , subq_1.ds_partitioned__year + , subq_1.ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month , subq_1.paid_at__quarter , subq_1.paid_at__year + , subq_1.paid_at__extract_year + , subq_1.paid_at__extract_quarter + , subq_1.paid_at__extract_month + , subq_1.paid_at__extract_week + , subq_1.paid_at__extract_day + , subq_1.paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month , subq_1.booking__ds__quarter , subq_1.booking__ds__year + , subq_1.booking__ds__extract_year + , subq_1.booking__ds__extract_quarter + , subq_1.booking__ds__extract_month + , subq_1.booking__ds__extract_week + , subq_1.booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month , subq_1.booking__paid_at__quarter , subq_1.booking__paid_at__year + , subq_1.booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -82,31 +124,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -156,32 +240,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -217,21 +343,49 @@ CROSS JOIN ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month , subq_7.created_at__quarter , subq_7.created_at__year + , subq_7.created_at__extract_year + , subq_7.created_at__extract_quarter + , subq_7.created_at__extract_month + , subq_7.created_at__extract_week + , subq_7.created_at__extract_day + , subq_7.created_at__extract_dayofweek + , subq_7.created_at__extract_dayofyear , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month , subq_7.listing__ds__quarter , subq_7.listing__ds__year + , subq_7.listing__ds__extract_year + , subq_7.listing__ds__extract_quarter + , subq_7.listing__ds__extract_month + , subq_7.listing__ds__extract_week + , subq_7.listing__ds__extract_day + , subq_7.listing__ds__extract_dayofweek + , subq_7.listing__ds__extract_dayofyear , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month , subq_7.listing__created_at__quarter , subq_7.listing__created_at__year + , subq_7.listing__created_at__extract_year + , subq_7.listing__created_at__extract_quarter + , subq_7.listing__created_at__extract_month + , subq_7.listing__created_at__extract_week + , subq_7.listing__created_at__extract_day + , subq_7.listing__created_at__extract_dayofweek + , subq_7.listing__created_at__extract_dayofyear , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -257,21 +411,49 @@ CROSS JOIN ( , subq_6.ds__month , subq_6.ds__quarter , subq_6.ds__year + , subq_6.ds__extract_year + , subq_6.ds__extract_quarter + , subq_6.ds__extract_month + , subq_6.ds__extract_week + , subq_6.ds__extract_day + , subq_6.ds__extract_dayofweek + , subq_6.ds__extract_dayofyear , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month , subq_6.created_at__quarter , subq_6.created_at__year + , subq_6.created_at__extract_year + , subq_6.created_at__extract_quarter + , subq_6.created_at__extract_month + , subq_6.created_at__extract_week + , subq_6.created_at__extract_day + , subq_6.created_at__extract_dayofweek + , subq_6.created_at__extract_dayofyear , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month , subq_6.listing__ds__quarter , subq_6.listing__ds__year + , subq_6.listing__ds__extract_year + , subq_6.listing__ds__extract_quarter + , subq_6.listing__ds__extract_month + , subq_6.listing__ds__extract_week + , subq_6.listing__ds__extract_day + , subq_6.listing__ds__extract_dayofweek + , subq_6.listing__ds__extract_dayofyear , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month , subq_6.listing__created_at__quarter , subq_6.listing__created_at__year + , subq_6.listing__created_at__extract_year + , subq_6.listing__created_at__extract_quarter + , subq_6.listing__created_at__extract_month + , subq_6.listing__created_at__extract_week + , subq_6.listing__created_at__extract_day + , subq_6.listing__created_at__extract_dayofweek + , subq_6.listing__created_at__extract_dayofyear , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -300,11 +482,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -313,11 +509,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql index 14a9f0385a..dc0afd0f09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql @@ -44,31 +44,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -118,32 +160,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -182,31 +266,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -256,32 +382,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,31 +500,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -406,32 +616,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -480,31 +732,73 @@ FROM ( , subq_17.ds__month , subq_17.ds__quarter , subq_17.ds__year + , subq_17.ds__extract_year + , subq_17.ds__extract_quarter + , subq_17.ds__extract_month + , subq_17.ds__extract_week + , subq_17.ds__extract_day + , subq_17.ds__extract_dayofweek + , subq_17.ds__extract_dayofyear , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month , subq_17.ds_partitioned__quarter , subq_17.ds_partitioned__year + , subq_17.ds_partitioned__extract_year + , subq_17.ds_partitioned__extract_quarter + , subq_17.ds_partitioned__extract_month + , subq_17.ds_partitioned__extract_week + , subq_17.ds_partitioned__extract_day + , subq_17.ds_partitioned__extract_dayofweek + , subq_17.ds_partitioned__extract_dayofyear , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month , subq_17.paid_at__quarter , subq_17.paid_at__year + , subq_17.paid_at__extract_year + , subq_17.paid_at__extract_quarter + , subq_17.paid_at__extract_month + , subq_17.paid_at__extract_week + , subq_17.paid_at__extract_day + , subq_17.paid_at__extract_dayofweek + , subq_17.paid_at__extract_dayofyear , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month , subq_17.booking__ds__quarter , subq_17.booking__ds__year + , subq_17.booking__ds__extract_year + , subq_17.booking__ds__extract_quarter + , subq_17.booking__ds__extract_month + , subq_17.booking__ds__extract_week + , subq_17.booking__ds__extract_day + , subq_17.booking__ds__extract_dayofweek + , subq_17.booking__ds__extract_dayofyear , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month , subq_17.booking__ds_partitioned__quarter , subq_17.booking__ds_partitioned__year + , subq_17.booking__ds_partitioned__extract_year + , subq_17.booking__ds_partitioned__extract_quarter + , subq_17.booking__ds_partitioned__extract_month + , subq_17.booking__ds_partitioned__extract_week + , subq_17.booking__ds_partitioned__extract_day + , subq_17.booking__ds_partitioned__extract_dayofweek + , subq_17.booking__ds_partitioned__extract_dayofyear , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month , subq_17.booking__paid_at__quarter , subq_17.booking__paid_at__year + , subq_17.booking__paid_at__extract_year + , subq_17.booking__paid_at__extract_quarter + , subq_17.booking__paid_at__extract_month + , subq_17.booking__paid_at__extract_week + , subq_17.booking__paid_at__extract_day + , subq_17.booking__paid_at__extract_dayofweek + , subq_17.booking__paid_at__extract_dayofyear , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -554,32 +848,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql index be96decab5..63116a5458 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql @@ -45,32 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql index a5288e7009..a53f3a075b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month , subq_0.verification__ds__quarter , subq_0.verification__ds__year + , subq_0.verification__ds__extract_year + , subq_0.verification__ds__extract_quarter + , subq_0.verification__ds__extract_month + , subq_0.verification__ds__extract_week + , subq_0.verification__ds__extract_day + , subq_0.verification__ds__extract_dayofweek + , subq_0.verification__ds__extract_dayofyear , subq_0.verification__ds_partitioned__day , 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.verification__ds_partitioned__extract_year + , subq_0.verification__ds_partitioned__extract_quarter + , subq_0.verification__ds_partitioned__extract_month + , subq_0.verification__ds_partitioned__extract_week + , subq_0.verification__ds_partitioned__extract_day + , subq_0.verification__ds_partitioned__extract_dayofweek + , subq_0.verification__ds_partitioned__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -71,22 +99,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -110,32 +166,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql index c65a58a300..d88d2d32f3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -54,12 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql index 603dac8609..094486f462 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql index adfa1c3f03..a8a26c9899 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 48a1b43de5..c400372dd4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 08a913aa57..30ab4c1851 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ed796b148d..ef337f422c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql index 782ccc2826..16b897731d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -83,11 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -96,11 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql index 0f449eb59e..7dd5c3b39d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql index ee19129508..e240956212 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql index 214766cb17..073c7964da 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -239,32 +365,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql index 63637a9433..c80b16baf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 9c4d91d069..d5d52443ea 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -51,31 +51,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,32 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -175,21 +259,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -218,11 +330,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -231,11 +357,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -296,21 +436,49 @@ FROM ( , subq_10.ds__month , subq_10.ds__quarter , subq_10.ds__year + , subq_10.ds__extract_year + , subq_10.ds__extract_quarter + , subq_10.ds__extract_month + , subq_10.ds__extract_week + , subq_10.ds__extract_day + , subq_10.ds__extract_dayofweek + , subq_10.ds__extract_dayofyear , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month , subq_10.ds_partitioned__quarter , subq_10.ds_partitioned__year + , subq_10.ds_partitioned__extract_year + , subq_10.ds_partitioned__extract_quarter + , subq_10.ds_partitioned__extract_month + , subq_10.ds_partitioned__extract_week + , subq_10.ds_partitioned__extract_day + , subq_10.ds_partitioned__extract_dayofweek + , subq_10.ds_partitioned__extract_dayofyear , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month , subq_10.view__ds__quarter , subq_10.view__ds__year + , subq_10.view__ds__extract_year + , subq_10.view__ds__extract_quarter + , subq_10.view__ds__extract_month + , subq_10.view__ds__extract_week + , subq_10.view__ds__extract_day + , subq_10.view__ds__extract_dayofweek + , subq_10.view__ds__extract_dayofyear , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month , subq_10.view__ds_partitioned__quarter , subq_10.view__ds_partitioned__year + , subq_10.view__ds_partitioned__extract_year + , subq_10.view__ds_partitioned__extract_quarter + , subq_10.view__ds_partitioned__extract_month + , subq_10.view__ds_partitioned__extract_week + , subq_10.view__ds_partitioned__extract_day + , subq_10.view__ds_partitioned__extract_dayofweek + , subq_10.view__ds_partitioned__extract_dayofyear , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -330,21 +498,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year + , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year + , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -367,21 +563,49 @@ FROM ( , subq_13.ds__month , subq_13.ds__quarter , subq_13.ds__year + , subq_13.ds__extract_year + , subq_13.ds__extract_quarter + , subq_13.ds__extract_month + , subq_13.ds__extract_week + , subq_13.ds__extract_day + , subq_13.ds__extract_dayofweek + , subq_13.ds__extract_dayofyear , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month , subq_13.created_at__quarter , subq_13.created_at__year + , subq_13.created_at__extract_year + , subq_13.created_at__extract_quarter + , subq_13.created_at__extract_month + , subq_13.created_at__extract_week + , subq_13.created_at__extract_day + , subq_13.created_at__extract_dayofweek + , subq_13.created_at__extract_dayofyear , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month , subq_13.listing__ds__quarter , subq_13.listing__ds__year + , subq_13.listing__ds__extract_year + , subq_13.listing__ds__extract_quarter + , subq_13.listing__ds__extract_month + , subq_13.listing__ds__extract_week + , subq_13.listing__ds__extract_day + , subq_13.listing__ds__extract_dayofweek + , subq_13.listing__ds__extract_dayofyear , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month , subq_13.listing__created_at__quarter , subq_13.listing__created_at__year + , subq_13.listing__created_at__extract_year + , subq_13.listing__created_at__extract_quarter + , subq_13.listing__created_at__extract_month + , subq_13.listing__created_at__extract_week + , subq_13.listing__created_at__extract_day + , subq_13.listing__created_at__extract_dayofweek + , subq_13.listing__created_at__extract_dayofyear , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -410,11 +634,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -423,11 +661,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index dd55a54b61..a56183e745 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,32 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -99,11 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -112,11 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql index 48583b238a..b6f01861d7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,32 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -96,11 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -109,11 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql index 4ca35f2544..d480357663 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql @@ -38,32 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql index b515ad2da5..f52c8d6acf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql index 5eb893b84a..4e79154b70 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql index 2393630095..f44071348d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql @@ -18,11 +18,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -40,11 +54,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql index 9ced88e0cc..4c321e73b0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -43,11 +57,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index dd00d2b15e..4821d797fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql index 658dcf3357..2a39c9282f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql @@ -21,11 +21,25 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month , subq_1.company__ds__quarter , subq_1.company__ds__year + , subq_1.company__ds__extract_year + , subq_1.company__ds__extract_quarter + , subq_1.company__ds__extract_month + , subq_1.company__ds__extract_week + , subq_1.company__ds__extract_day + , subq_1.company__ds__extract_dayofweek + , subq_1.company__ds__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -42,11 +56,25 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month , subq_0.company__ds__quarter , subq_0.company__ds__year + , subq_0.company__ds__extract_year + , subq_0.company__ds__extract_quarter + , subq_0.company__ds__extract_month + , subq_0.company__ds__extract_week + , subq_0.company__ds__extract_day + , subq_0.company__ds__extract_dayofweek + , subq_0.company__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year + , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql index 9bafb5e1f6..82ded0a878 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -170,31 +254,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -244,32 +370,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql index edbbe545fd..f21c6e33a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index c97b8fd930..34b929887f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql index 03b1c29282..44073119ae 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 6a32edb464..66bd68c2c6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -32,31 +32,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -106,32 +148,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -171,31 +255,73 @@ FROM ( , subq_6.ds__month AS ds__month , subq_6.ds__quarter AS ds__quarter , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month , subq_6.paid_at__quarter AS paid_at__quarter , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month , subq_6.booking__ds__quarter AS booking__ds__quarter , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -231,31 +357,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -305,32 +473,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index d52164ec94..9ab70d9a6a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -235,31 +361,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -295,31 +463,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -369,32 +579,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 1a2a3259ba..34b0e577f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -33,31 +33,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -93,31 +135,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -167,32 +251,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -236,31 +362,73 @@ FROM ( , subq_9.ds__month AS ds__month , subq_9.ds__quarter AS ds__quarter , subq_9.ds__year AS ds__year + , subq_9.ds__extract_year AS ds__extract_year + , subq_9.ds__extract_quarter AS ds__extract_quarter + , subq_9.ds__extract_month AS ds__extract_month + , subq_9.ds__extract_week AS ds__extract_week + , subq_9.ds__extract_day AS ds__extract_day + , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month , subq_9.ds_partitioned__quarter AS ds_partitioned__quarter , subq_9.ds_partitioned__year AS ds_partitioned__year + , subq_9.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_9.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month , subq_9.paid_at__quarter AS paid_at__quarter , subq_9.paid_at__year AS paid_at__year + , subq_9.paid_at__extract_year AS paid_at__extract_year + , subq_9.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_9.paid_at__extract_month AS paid_at__extract_month + , subq_9.paid_at__extract_week AS paid_at__extract_week + , subq_9.paid_at__extract_day AS paid_at__extract_day + , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month , subq_9.booking__ds__quarter AS booking__ds__quarter , subq_9.booking__ds__year AS booking__ds__year + , subq_9.booking__ds__extract_year AS booking__ds__extract_year + , subq_9.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_9.booking__ds__extract_month AS booking__ds__extract_month + , subq_9.booking__ds__extract_week AS booking__ds__extract_week + , subq_9.booking__ds__extract_day AS booking__ds__extract_day + , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_9.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_9.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_9.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_9.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month , subq_9.booking__paid_at__quarter AS booking__paid_at__quarter , subq_9.booking__paid_at__year AS booking__paid_at__year + , subq_9.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_9.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -296,31 +464,73 @@ FROM ( , subq_8.ds__month , subq_8.ds__quarter , subq_8.ds__year + , subq_8.ds__extract_year + , subq_8.ds__extract_quarter + , subq_8.ds__extract_month + , subq_8.ds__extract_week + , subq_8.ds__extract_day + , subq_8.ds__extract_dayofweek + , subq_8.ds__extract_dayofyear , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month , subq_8.ds_partitioned__quarter , subq_8.ds_partitioned__year + , subq_8.ds_partitioned__extract_year + , subq_8.ds_partitioned__extract_quarter + , subq_8.ds_partitioned__extract_month + , subq_8.ds_partitioned__extract_week + , subq_8.ds_partitioned__extract_day + , subq_8.ds_partitioned__extract_dayofweek + , subq_8.ds_partitioned__extract_dayofyear , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month , subq_8.paid_at__quarter , subq_8.paid_at__year + , subq_8.paid_at__extract_year + , subq_8.paid_at__extract_quarter + , subq_8.paid_at__extract_month + , subq_8.paid_at__extract_week + , subq_8.paid_at__extract_day + , subq_8.paid_at__extract_dayofweek + , subq_8.paid_at__extract_dayofyear , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month , subq_8.booking__ds__quarter , subq_8.booking__ds__year + , subq_8.booking__ds__extract_year + , subq_8.booking__ds__extract_quarter + , subq_8.booking__ds__extract_month + , subq_8.booking__ds__extract_week + , subq_8.booking__ds__extract_day + , subq_8.booking__ds__extract_dayofweek + , subq_8.booking__ds__extract_dayofyear , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month , subq_8.booking__ds_partitioned__quarter , subq_8.booking__ds_partitioned__year + , subq_8.booking__ds_partitioned__extract_year + , subq_8.booking__ds_partitioned__extract_quarter + , subq_8.booking__ds_partitioned__extract_month + , subq_8.booking__ds_partitioned__extract_week + , subq_8.booking__ds_partitioned__extract_day + , subq_8.booking__ds_partitioned__extract_dayofweek + , subq_8.booking__ds_partitioned__extract_dayofyear , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month , subq_8.booking__paid_at__quarter , subq_8.booking__paid_at__year + , subq_8.booking__paid_at__extract_year + , subq_8.booking__paid_at__extract_quarter + , subq_8.booking__paid_at__extract_month + , subq_8.booking__paid_at__extract_week + , subq_8.booking__paid_at__extract_day + , subq_8.booking__paid_at__extract_dayofweek + , subq_8.booking__paid_at__extract_dayofyear , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -370,32 +580,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql index edd3eef59c..390f041085 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_4.ds__month AS ds__month , subq_4.ds__quarter AS ds__quarter , subq_4.ds__year AS ds__year + , subq_4.ds__extract_year AS ds__extract_year + , subq_4.ds__extract_quarter AS ds__extract_quarter + , subq_4.ds__extract_month AS ds__extract_month + , subq_4.ds__extract_week AS ds__extract_week + , subq_4.ds__extract_day AS ds__extract_day + , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month , subq_4.ds_partitioned__quarter AS ds_partitioned__quarter , subq_4.ds_partitioned__year AS ds_partitioned__year + , subq_4.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month , subq_4.paid_at__quarter AS paid_at__quarter , subq_4.paid_at__year AS paid_at__year + , subq_4.paid_at__extract_year AS paid_at__extract_year + , subq_4.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_4.paid_at__extract_month AS paid_at__extract_month + , subq_4.paid_at__extract_week AS paid_at__extract_week + , subq_4.paid_at__extract_day AS paid_at__extract_day + , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month , subq_4.booking__ds__quarter AS booking__ds__quarter , subq_4.booking__ds__year AS booking__ds__year + , subq_4.booking__ds__extract_year AS booking__ds__extract_year + , subq_4.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_4.booking__ds__extract_month AS booking__ds__extract_month + , subq_4.booking__ds__extract_week AS booking__ds__extract_week + , subq_4.booking__ds__extract_day AS booking__ds__extract_day + , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_4.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_4.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_4.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_4.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month , subq_4.booking__paid_at__quarter AS booking__paid_at__quarter , subq_4.booking__paid_at__year AS booking__paid_at__year + , subq_4.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_4.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -88,31 +130,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -152,31 +236,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -226,32 +352,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql index 26c360ab9e..3c8d87a17b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_1.ds__month AS ds__month , subq_1.ds__quarter AS ds__quarter , subq_1.ds__year AS ds__year + , subq_1.ds__extract_year AS ds__extract_year + , subq_1.ds__extract_quarter AS ds__extract_quarter + , subq_1.ds__extract_month AS ds__extract_month + , subq_1.ds__extract_week AS ds__extract_week + , subq_1.ds__extract_day AS ds__extract_day + , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month , subq_1.ds_partitioned__quarter AS ds_partitioned__quarter , subq_1.ds_partitioned__year AS ds_partitioned__year + , subq_1.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month , subq_1.paid_at__quarter AS paid_at__quarter , subq_1.paid_at__year AS paid_at__year + , subq_1.paid_at__extract_year AS paid_at__extract_year + , subq_1.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_1.paid_at__extract_month AS paid_at__extract_month + , subq_1.paid_at__extract_week AS paid_at__extract_week + , subq_1.paid_at__extract_day AS paid_at__extract_day + , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month , subq_1.booking__ds__quarter AS booking__ds__quarter , subq_1.booking__ds__year AS booking__ds__year + , subq_1.booking__ds__extract_year AS booking__ds__extract_year + , subq_1.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_1.booking__ds__extract_month AS booking__ds__extract_month + , subq_1.booking__ds__extract_week AS booking__ds__extract_week + , subq_1.booking__ds__extract_day AS booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month , subq_1.booking__paid_at__quarter AS booking__paid_at__quarter , subq_1.booking__paid_at__year AS booking__paid_at__year + , subq_1.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -87,31 +129,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -161,32 +245,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql index 870b2c80ea..3adff18e62 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql @@ -42,31 +42,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,32 +158,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -166,21 +250,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -209,11 +321,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -222,11 +348,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql index ddba65921c..00efad0383 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql @@ -25,32 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql index 7ce1a71c7f..7e0fdff19e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql index 81e6d39ada..eb70f04221 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -48,31 +48,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,32 +164,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -172,21 +256,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -215,11 +327,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -228,11 +354,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql index 4caa3d07f0..f7de81777d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__day AS listing__window_end__day + , subq_4.window_start__extract_month AS listing__window_start__extract_month + , subq_4.window_end__extract_day AS listing__window_end__extract_day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -50,31 +50,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -110,32 +152,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -152,8 +236,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__day - , subq_3.window_end__day + subq_3.window_start__extract_month + , subq_3.window_end__extract_day , subq_3.listing , subq_3.capacity FROM ( @@ -164,11 +248,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -177,11 +275,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -196,12 +308,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__day + subq_2.metric_time__day >= subq_4.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__day + subq_2.metric_time__day < subq_4.window_end__extract_day ) OR ( - subq_4.window_end__day IS NULL + subq_4.window_end__extract_day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql index 86a2010b35..8e679fa648 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < EXTRACT(DAY FROM listings_src_10017.active_to) ) OR ( - listings_src_10017.active_to IS NULL + EXTRACT(DAY FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ed1bd4e99..6ef8853985 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql index 22702f0c48..29fb5d972e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql index 027f20ea5b..16e8afe8d0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql @@ -37,31 +37,73 @@ INNER JOIN ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -111,32 +153,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql index 913fed793c..b00d690648 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql @@ -26,31 +26,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql index 86b30c4553..583b4a4bf0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql @@ -21,21 +21,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month , subq_0.created_at__quarter , subq_0.created_at__year + , subq_0.created_at__extract_year + , subq_0.created_at__extract_quarter + , subq_0.created_at__extract_month + , subq_0.created_at__extract_week + , subq_0.created_at__extract_day + , subq_0.created_at__extract_dayofweek + , subq_0.created_at__extract_dayofyear , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month , subq_0.listing__ds__quarter , subq_0.listing__ds__year + , subq_0.listing__ds__extract_year + , subq_0.listing__ds__extract_quarter + , subq_0.listing__ds__extract_month + , subq_0.listing__ds__extract_week + , subq_0.listing__ds__extract_day + , subq_0.listing__ds__extract_dayofweek + , subq_0.listing__ds__extract_dayofyear , subq_0.listing__created_at__day , 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.listing__created_at__extract_year + , subq_0.listing__created_at__extract_quarter + , subq_0.listing__created_at__extract_month + , subq_0.listing__created_at__extract_week + , subq_0.listing__created_at__extract_day + , subq_0.listing__created_at__extract_dayofweek + , subq_0.listing__created_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -64,11 +92,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -77,11 +119,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql index 316737d00a..b05da97264 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql @@ -35,32 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql index 73e6a70d92..437dc887b4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql @@ -60,31 +60,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -134,32 +176,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -184,21 +268,49 @@ FROM ( , subq_3.ds__month , subq_3.ds__quarter , subq_3.ds__year + , subq_3.ds__extract_year + , subq_3.ds__extract_quarter + , subq_3.ds__extract_month + , subq_3.ds__extract_week + , subq_3.ds__extract_day + , subq_3.ds__extract_dayofweek + , subq_3.ds__extract_dayofyear , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month , subq_3.created_at__quarter , subq_3.created_at__year + , subq_3.created_at__extract_year + , subq_3.created_at__extract_quarter + , subq_3.created_at__extract_month + , subq_3.created_at__extract_week + , subq_3.created_at__extract_day + , subq_3.created_at__extract_dayofweek + , subq_3.created_at__extract_dayofyear , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month , subq_3.listing__ds__quarter , subq_3.listing__ds__year + , subq_3.listing__ds__extract_year + , subq_3.listing__ds__extract_quarter + , subq_3.listing__ds__extract_month + , subq_3.listing__ds__extract_week + , subq_3.listing__ds__extract_day + , subq_3.listing__ds__extract_dayofweek + , subq_3.listing__ds__extract_dayofyear , subq_3.listing__created_at__day , 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.listing__created_at__extract_year + , subq_3.listing__created_at__extract_quarter + , subq_3.listing__created_at__extract_month + , subq_3.listing__created_at__extract_week + , subq_3.listing__created_at__extract_day + , subq_3.listing__created_at__extract_dayofweek + , subq_3.listing__created_at__extract_dayofyear , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -227,11 +339,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -240,11 +366,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -317,31 +457,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -391,32 +573,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -441,21 +665,49 @@ FROM ( , subq_15.ds__month , subq_15.ds__quarter , subq_15.ds__year + , subq_15.ds__extract_year + , subq_15.ds__extract_quarter + , subq_15.ds__extract_month + , subq_15.ds__extract_week + , subq_15.ds__extract_day + , subq_15.ds__extract_dayofweek + , subq_15.ds__extract_dayofyear , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month , subq_15.created_at__quarter , subq_15.created_at__year + , subq_15.created_at__extract_year + , subq_15.created_at__extract_quarter + , subq_15.created_at__extract_month + , subq_15.created_at__extract_week + , subq_15.created_at__extract_day + , subq_15.created_at__extract_dayofweek + , subq_15.created_at__extract_dayofyear , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month , subq_15.listing__ds__quarter , subq_15.listing__ds__year + , subq_15.listing__ds__extract_year + , subq_15.listing__ds__extract_quarter + , subq_15.listing__ds__extract_month + , subq_15.listing__ds__extract_week + , subq_15.listing__ds__extract_day + , subq_15.listing__ds__extract_dayofweek + , subq_15.listing__ds__extract_dayofyear , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month , subq_15.listing__created_at__quarter , subq_15.listing__created_at__year + , subq_15.listing__created_at__extract_year + , subq_15.listing__created_at__extract_quarter + , subq_15.listing__created_at__extract_month + , subq_15.listing__created_at__extract_week + , subq_15.listing__created_at__extract_day + , subq_15.listing__created_at__extract_dayofweek + , subq_15.listing__created_at__extract_dayofyear , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -484,11 +736,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -497,11 +763,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -557,31 +837,73 @@ FROM ( , subq_24.ds__month , subq_24.ds__quarter , subq_24.ds__year + , subq_24.ds__extract_year + , subq_24.ds__extract_quarter + , subq_24.ds__extract_month + , subq_24.ds__extract_week + , subq_24.ds__extract_day + , subq_24.ds__extract_dayofweek + , subq_24.ds__extract_dayofyear , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month , subq_24.ds_partitioned__quarter , subq_24.ds_partitioned__year + , subq_24.ds_partitioned__extract_year + , subq_24.ds_partitioned__extract_quarter + , subq_24.ds_partitioned__extract_month + , subq_24.ds_partitioned__extract_week + , subq_24.ds_partitioned__extract_day + , subq_24.ds_partitioned__extract_dayofweek + , subq_24.ds_partitioned__extract_dayofyear , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month , subq_24.paid_at__quarter , subq_24.paid_at__year + , subq_24.paid_at__extract_year + , subq_24.paid_at__extract_quarter + , subq_24.paid_at__extract_month + , subq_24.paid_at__extract_week + , subq_24.paid_at__extract_day + , subq_24.paid_at__extract_dayofweek + , subq_24.paid_at__extract_dayofyear , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month , subq_24.booking__ds__quarter , subq_24.booking__ds__year + , subq_24.booking__ds__extract_year + , subq_24.booking__ds__extract_quarter + , subq_24.booking__ds__extract_month + , subq_24.booking__ds__extract_week + , subq_24.booking__ds__extract_day + , subq_24.booking__ds__extract_dayofweek + , subq_24.booking__ds__extract_dayofyear , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month , subq_24.booking__ds_partitioned__quarter , subq_24.booking__ds_partitioned__year + , subq_24.booking__ds_partitioned__extract_year + , subq_24.booking__ds_partitioned__extract_quarter + , subq_24.booking__ds_partitioned__extract_month + , subq_24.booking__ds_partitioned__extract_week + , subq_24.booking__ds_partitioned__extract_day + , subq_24.booking__ds_partitioned__extract_dayofweek + , subq_24.booking__ds_partitioned__extract_dayofyear , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month , subq_24.booking__paid_at__quarter , subq_24.booking__paid_at__year + , subq_24.booking__paid_at__extract_year + , subq_24.booking__paid_at__extract_quarter + , subq_24.booking__paid_at__extract_month + , subq_24.booking__paid_at__extract_week + , subq_24.booking__paid_at__extract_day + , subq_24.booking__paid_at__extract_dayofweek + , subq_24.booking__paid_at__extract_dayofyear , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -631,32 +953,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql index 4176ca90e9..37ad3a608e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql @@ -45,31 +45,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,32 +161,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -186,31 +270,73 @@ FROM ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month , subq_7.ds_partitioned__quarter , subq_7.ds_partitioned__year + , subq_7.ds_partitioned__extract_year + , subq_7.ds_partitioned__extract_quarter + , subq_7.ds_partitioned__extract_month + , subq_7.ds_partitioned__extract_week + , subq_7.ds_partitioned__extract_day + , subq_7.ds_partitioned__extract_dayofweek + , subq_7.ds_partitioned__extract_dayofyear , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month , subq_7.paid_at__quarter , subq_7.paid_at__year + , subq_7.paid_at__extract_year + , subq_7.paid_at__extract_quarter + , subq_7.paid_at__extract_month + , subq_7.paid_at__extract_week + , subq_7.paid_at__extract_day + , subq_7.paid_at__extract_dayofweek + , subq_7.paid_at__extract_dayofyear , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month , subq_7.booking__ds__quarter , subq_7.booking__ds__year + , subq_7.booking__ds__extract_year + , subq_7.booking__ds__extract_quarter + , subq_7.booking__ds__extract_month + , subq_7.booking__ds__extract_week + , subq_7.booking__ds__extract_day + , subq_7.booking__ds__extract_dayofweek + , subq_7.booking__ds__extract_dayofyear , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month , subq_7.booking__ds_partitioned__quarter , subq_7.booking__ds_partitioned__year + , subq_7.booking__ds_partitioned__extract_year + , subq_7.booking__ds_partitioned__extract_quarter + , subq_7.booking__ds_partitioned__extract_month + , subq_7.booking__ds_partitioned__extract_week + , subq_7.booking__ds_partitioned__extract_day + , subq_7.booking__ds_partitioned__extract_dayofweek + , subq_7.booking__ds_partitioned__extract_dayofyear , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month , subq_7.booking__paid_at__quarter , subq_7.booking__paid_at__year + , subq_7.booking__paid_at__extract_year + , subq_7.booking__paid_at__extract_quarter + , subq_7.booking__paid_at__extract_month + , subq_7.booking__paid_at__extract_week + , subq_7.booking__paid_at__extract_day + , subq_7.booking__paid_at__extract_dayofweek + , subq_7.booking__paid_at__extract_dayofyear , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -260,32 +386,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 13d80a91d0..a495423238 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -39,31 +39,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -113,32 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 14ec230f17..0e4cdb1a6a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -160,21 +244,49 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month , subq_5.created_at__quarter , subq_5.created_at__year + , subq_5.created_at__extract_year + , subq_5.created_at__extract_quarter + , subq_5.created_at__extract_month + , subq_5.created_at__extract_week + , subq_5.created_at__extract_day + , subq_5.created_at__extract_dayofweek + , subq_5.created_at__extract_dayofyear , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month , subq_5.listing__ds__quarter , subq_5.listing__ds__year + , subq_5.listing__ds__extract_year + , subq_5.listing__ds__extract_quarter + , subq_5.listing__ds__extract_month + , subq_5.listing__ds__extract_week + , subq_5.listing__ds__extract_day + , subq_5.listing__ds__extract_dayofweek + , subq_5.listing__ds__extract_dayofyear , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month , subq_5.listing__created_at__quarter , subq_5.listing__created_at__year + , subq_5.listing__created_at__extract_year + , subq_5.listing__created_at__extract_quarter + , subq_5.listing__created_at__extract_month + , subq_5.listing__created_at__extract_week + , subq_5.listing__created_at__extract_day + , subq_5.listing__created_at__extract_dayofweek + , subq_5.listing__created_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -203,11 +315,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -216,11 +342,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql index 88cc0b431d..7509855402 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__day AS listing__window_start__day - , subq_7.window_end__day AS listing__window_end__day + , subq_7.window_start__extract_month AS listing__window_start__extract_month + , subq_7.window_end__extract_day AS listing__window_end__extract_day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -142,8 +226,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__day - , subq_6.window_end__day + subq_6.window_start__extract_month + , subq_6.window_end__extract_day , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -154,26 +238,61 @@ FROM ( , subq_3.window_start__month AS window_start__month , subq_3.window_start__quarter AS window_start__quarter , subq_3.window_start__year AS window_start__year + , subq_3.window_start__extract_year AS window_start__extract_year + , subq_3.window_start__extract_quarter AS window_start__extract_quarter + , subq_3.window_start__extract_month AS window_start__extract_month + , subq_3.window_start__extract_week AS window_start__extract_week + , subq_3.window_start__extract_day AS window_start__extract_day + , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek + , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month , subq_3.window_end__quarter AS window_end__quarter , subq_3.window_end__year AS window_end__year + , subq_3.window_end__extract_year AS window_end__extract_year + , subq_3.window_end__extract_quarter AS window_end__extract_quarter + , subq_3.window_end__extract_month AS window_end__extract_month + , subq_3.window_end__extract_week AS window_end__extract_week + , subq_3.window_end__extract_day AS window_end__extract_day + , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek + , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month , subq_3.listing__window_start__quarter AS listing__window_start__quarter , subq_3.listing__window_start__year AS listing__window_start__year + , subq_3.listing__window_start__extract_year AS listing__window_start__extract_year + , subq_3.listing__window_start__extract_quarter AS listing__window_start__extract_quarter + , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month + , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week + , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day + , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek + , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month , subq_3.listing__window_end__quarter AS listing__window_end__quarter , subq_3.listing__window_end__year AS listing__window_end__year + , subq_3.listing__window_end__extract_year AS listing__window_end__extract_year + , subq_3.listing__window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month + , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week + , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day + , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month , subq_5.ds__quarter AS user__ds__quarter , subq_5.ds__year AS user__ds__year + , subq_5.ds__extract_year AS user__ds__extract_year + , subq_5.ds__extract_quarter AS user__ds__extract_quarter + , subq_5.ds__extract_month AS user__ds__extract_month + , subq_5.ds__extract_week AS user__ds__extract_week + , subq_5.ds__extract_day AS user__ds__extract_day + , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek + , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -192,11 +311,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -205,11 +338,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year + , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -227,11 +374,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', + -- 'ds__day', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', + -- 'user__ds__day', -- 'user'] SELECT subq_4.ds__day @@ -239,11 +400,25 @@ FROM ( , subq_4.ds__month , subq_4.ds__quarter , subq_4.ds__year + , subq_4.ds__extract_year + , subq_4.ds__extract_quarter + , subq_4.ds__extract_month + , subq_4.ds__extract_week + , subq_4.ds__extract_day + , subq_4.ds__extract_dayofweek + , subq_4.ds__extract_dayofyear , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month , subq_4.user__ds__quarter , subq_4.user__ds__year + , subq_4.user__ds__extract_year + , subq_4.user__ds__extract_quarter + , subq_4.user__ds__extract_month + , subq_4.user__ds__extract_week + , subq_4.user__ds__extract_day + , subq_4.user__ds__extract_dayofweek + , subq_4.user__ds__extract_dayofyear , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -255,12 +430,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 @@ -275,12 +464,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__day + subq_2.metric_time__day >= subq_7.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__day + subq_2.metric_time__day < subq_7.window_end__extract_day ) OR ( - subq_7.window_end__day IS NULL + subq_7.window_end__extract_day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql index feb5ed0fdc..dac9dfcf79 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , listings_src_10017.active_to AS window_end__day + EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__day + subq_13.metric_time__day >= subq_18.window_start__extract_month ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__day + subq_13.metric_time__day < subq_18.window_end__extract_day ) OR ( - subq_18.window_end__day IS NULL + subq_18.window_end__extract_day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql index 94054a124c..27cc3589f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day + , subq_7.lux_listing__window_start__extract_month AS listing__lux_listing__window_start__extract_month + , subq_7.lux_listing__window_end__extract_week AS listing__lux_listing__window_end__extract_week , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -40,31 +40,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -100,32 +142,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -145,8 +229,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__day + subq_6.lux_listing__window_start__extract_month + , subq_6.lux_listing__window_end__extract_week , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -157,11 +241,25 @@ FROM ( , subq_5.window_start__month AS lux_listing__window_start__month , subq_5.window_start__quarter AS lux_listing__window_start__quarter , subq_5.window_start__year AS lux_listing__window_start__year + , subq_5.window_start__extract_year AS lux_listing__window_start__extract_year + , subq_5.window_start__extract_quarter AS lux_listing__window_start__extract_quarter + , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month + , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week + , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day + , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek + , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month , subq_5.window_end__quarter AS lux_listing__window_end__quarter , subq_5.window_end__year AS lux_listing__window_end__year + , subq_5.window_end__extract_year AS lux_listing__window_end__extract_year + , subq_5.window_end__extract_quarter AS lux_listing__window_end__extract_quarter + , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month + , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week + , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day + , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek + , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -183,21 +281,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', + -- 'window_start__day', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', + -- 'window_end__day', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__day', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__day', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -205,21 +331,49 @@ FROM ( , subq_4.window_start__month , subq_4.window_start__quarter , subq_4.window_start__year + , subq_4.window_start__extract_year + , subq_4.window_start__extract_quarter + , subq_4.window_start__extract_month + , subq_4.window_start__extract_week + , subq_4.window_start__extract_day + , subq_4.window_start__extract_dayofweek + , subq_4.window_start__extract_dayofyear , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month , subq_4.window_end__quarter , subq_4.window_end__year + , subq_4.window_end__extract_year + , subq_4.window_end__extract_quarter + , subq_4.window_end__extract_month + , subq_4.window_end__extract_week + , subq_4.window_end__extract_day + , subq_4.window_end__extract_dayofweek + , subq_4.window_end__extract_dayofyear , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month , subq_4.lux_listing__window_start__quarter , subq_4.lux_listing__window_start__year + , subq_4.lux_listing__window_start__extract_year + , subq_4.lux_listing__window_start__extract_quarter + , subq_4.lux_listing__window_start__extract_month + , subq_4.lux_listing__window_start__extract_week + , subq_4.lux_listing__window_start__extract_day + , subq_4.lux_listing__window_start__extract_dayofweek + , subq_4.lux_listing__window_start__extract_dayofyear , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month , subq_4.lux_listing__window_end__quarter , subq_4.lux_listing__window_end__year + , subq_4.lux_listing__window_end__extract_year + , subq_4.lux_listing__window_end__extract_quarter + , subq_4.lux_listing__window_end__extract_month + , subq_4.lux_listing__window_end__extract_week + , subq_4.lux_listing__window_end__extract_day + , subq_4.lux_listing__window_end__extract_dayofweek + , subq_4.lux_listing__window_end__extract_dayofyear , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -231,22 +385,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year + , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 @@ -261,12 +443,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__day + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_week ) OR ( - subq_7.lux_listing__window_end__day IS NULL + subq_7.lux_listing__window_end__extract_week IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql index f1b419a284..f84156c6f9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , lux_listings_src_10019.valid_to AS lux_listing__window_end__day + EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_month ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__day + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_week ) OR ( - subq_18.lux_listing__window_end__day IS NULL + subq_18.lux_listing__window_end__extract_week IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql index ae8b7838b7..cb9670f074 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql @@ -33,32 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -85,11 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -98,11 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 @@ -131,11 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -144,11 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql index d35179ebf0..fbddd59f54 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.account_id__ds_partitioned__day , 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_partitioned__extract_year + , subq_0.account_id__ds_partitioned__extract_quarter + , subq_0.account_id__ds_partitioned__extract_month + , subq_0.account_id__ds_partitioned__extract_week + , subq_0.account_id__ds_partitioned__extract_day + , subq_0.account_id__ds_partitioned__extract_dayofweek + , subq_0.account_id__ds_partitioned__extract_dayofyear , subq_0.account_id__ds__day , 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.account_id__ds__extract_year + , subq_0.account_id__ds__extract_quarter + , subq_0.account_id__ds__extract_month + , subq_0.account_id__ds__extract_week + , subq_0.account_id__ds__extract_day + , subq_0.account_id__ds__extract_dayofweek + , subq_0.account_id__ds__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -69,22 +97,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year + , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -106,16 +162,37 @@ FROM ( , 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.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_3.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek + , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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_3.account_id__ds_partitioned__extract_year AS account_id__ds_partitioned__extract_year + , subq_3.account_id__ds_partitioned__extract_quarter AS account_id__ds_partitioned__extract_quarter + , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month + , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week + , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day + , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek + , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , 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_5.ds_partitioned__extract_year AS customer_id__ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter AS customer_id__ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear , 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 @@ -132,12 +209,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year + , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -154,11 +245,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', + -- 'ds_partitioned__day', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__day', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -166,11 +271,25 @@ FROM ( , subq_4.ds_partitioned__month , subq_4.ds_partitioned__quarter , subq_4.ds_partitioned__year + , subq_4.ds_partitioned__extract_year + , subq_4.ds_partitioned__extract_quarter + , subq_4.ds_partitioned__extract_month + , subq_4.ds_partitioned__extract_week + , subq_4.ds_partitioned__extract_day + , subq_4.ds_partitioned__extract_dayofweek + , subq_4.ds_partitioned__extract_dayofyear , subq_4.customer_id__ds_partitioned__day , 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__ds_partitioned__extract_year + , subq_4.customer_id__ds_partitioned__extract_quarter + , subq_4.customer_id__ds_partitioned__extract_month + , subq_4.customer_id__ds_partitioned__extract_week + , subq_4.customer_id__ds_partitioned__extract_day + , subq_4.customer_id__ds_partitioned__extract_dayofweek + , subq_4.customer_id__ds_partitioned__extract_dayofyear , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -186,6 +305,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -193,6 +319,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year + , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql index 5c9089deaf..eb31a4fb3a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql @@ -23,31 +23,73 @@ FROM ( , subq_1.ds__month , subq_1.ds__quarter , subq_1.ds__year + , subq_1.ds__extract_year + , subq_1.ds__extract_quarter + , subq_1.ds__extract_month + , subq_1.ds__extract_week + , subq_1.ds__extract_day + , subq_1.ds__extract_dayofweek + , subq_1.ds__extract_dayofyear , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month , subq_1.ds_partitioned__quarter , subq_1.ds_partitioned__year + , subq_1.ds_partitioned__extract_year + , subq_1.ds_partitioned__extract_quarter + , subq_1.ds_partitioned__extract_month + , subq_1.ds_partitioned__extract_week + , subq_1.ds_partitioned__extract_day + , subq_1.ds_partitioned__extract_dayofweek + , subq_1.ds_partitioned__extract_dayofyear , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month , subq_1.paid_at__quarter , subq_1.paid_at__year + , subq_1.paid_at__extract_year + , subq_1.paid_at__extract_quarter + , subq_1.paid_at__extract_month + , subq_1.paid_at__extract_week + , subq_1.paid_at__extract_day + , subq_1.paid_at__extract_dayofweek + , subq_1.paid_at__extract_dayofyear , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month , subq_1.booking__ds__quarter , subq_1.booking__ds__year + , subq_1.booking__ds__extract_year + , subq_1.booking__ds__extract_quarter + , subq_1.booking__ds__extract_month + , subq_1.booking__ds__extract_week + , subq_1.booking__ds__extract_day + , subq_1.booking__ds__extract_dayofweek + , subq_1.booking__ds__extract_dayofyear , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month , subq_1.booking__ds_partitioned__quarter , subq_1.booking__ds_partitioned__year + , subq_1.booking__ds_partitioned__extract_year + , subq_1.booking__ds_partitioned__extract_quarter + , subq_1.booking__ds_partitioned__extract_month + , subq_1.booking__ds_partitioned__extract_week + , subq_1.booking__ds_partitioned__extract_day + , subq_1.booking__ds_partitioned__extract_dayofweek + , subq_1.booking__ds_partitioned__extract_dayofyear , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month , subq_1.booking__paid_at__quarter , subq_1.booking__paid_at__year + , subq_1.booking__paid_at__extract_year + , subq_1.booking__paid_at__extract_quarter + , subq_1.booking__paid_at__extract_month + , subq_1.booking__paid_at__extract_week + , subq_1.booking__paid_at__extract_day + , subq_1.booking__paid_at__extract_dayofweek + , subq_1.booking__paid_at__extract_dayofyear , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -82,31 +124,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -156,32 +240,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -217,21 +343,49 @@ CROSS JOIN ( , subq_7.ds__month , subq_7.ds__quarter , subq_7.ds__year + , subq_7.ds__extract_year + , subq_7.ds__extract_quarter + , subq_7.ds__extract_month + , subq_7.ds__extract_week + , subq_7.ds__extract_day + , subq_7.ds__extract_dayofweek + , subq_7.ds__extract_dayofyear , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month , subq_7.created_at__quarter , subq_7.created_at__year + , subq_7.created_at__extract_year + , subq_7.created_at__extract_quarter + , subq_7.created_at__extract_month + , subq_7.created_at__extract_week + , subq_7.created_at__extract_day + , subq_7.created_at__extract_dayofweek + , subq_7.created_at__extract_dayofyear , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month , subq_7.listing__ds__quarter , subq_7.listing__ds__year + , subq_7.listing__ds__extract_year + , subq_7.listing__ds__extract_quarter + , subq_7.listing__ds__extract_month + , subq_7.listing__ds__extract_week + , subq_7.listing__ds__extract_day + , subq_7.listing__ds__extract_dayofweek + , subq_7.listing__ds__extract_dayofyear , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month , subq_7.listing__created_at__quarter , subq_7.listing__created_at__year + , subq_7.listing__created_at__extract_year + , subq_7.listing__created_at__extract_quarter + , subq_7.listing__created_at__extract_month + , subq_7.listing__created_at__extract_week + , subq_7.listing__created_at__extract_day + , subq_7.listing__created_at__extract_dayofweek + , subq_7.listing__created_at__extract_dayofyear , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -257,21 +411,49 @@ CROSS JOIN ( , subq_6.ds__month , subq_6.ds__quarter , subq_6.ds__year + , subq_6.ds__extract_year + , subq_6.ds__extract_quarter + , subq_6.ds__extract_month + , subq_6.ds__extract_week + , subq_6.ds__extract_day + , subq_6.ds__extract_dayofweek + , subq_6.ds__extract_dayofyear , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month , subq_6.created_at__quarter , subq_6.created_at__year + , subq_6.created_at__extract_year + , subq_6.created_at__extract_quarter + , subq_6.created_at__extract_month + , subq_6.created_at__extract_week + , subq_6.created_at__extract_day + , subq_6.created_at__extract_dayofweek + , subq_6.created_at__extract_dayofyear , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month , subq_6.listing__ds__quarter , subq_6.listing__ds__year + , subq_6.listing__ds__extract_year + , subq_6.listing__ds__extract_quarter + , subq_6.listing__ds__extract_month + , subq_6.listing__ds__extract_week + , subq_6.listing__ds__extract_day + , subq_6.listing__ds__extract_dayofweek + , subq_6.listing__ds__extract_dayofyear , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month , subq_6.listing__created_at__quarter , subq_6.listing__created_at__year + , subq_6.listing__created_at__extract_year + , subq_6.listing__created_at__extract_quarter + , subq_6.listing__created_at__extract_month + , subq_6.listing__created_at__extract_week + , subq_6.listing__created_at__extract_day + , subq_6.listing__created_at__extract_dayofweek + , subq_6.listing__created_at__extract_dayofyear , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -300,11 +482,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -313,11 +509,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql index 14a9f0385a..dc0afd0f09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql @@ -44,31 +44,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -118,32 +160,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -182,31 +266,73 @@ FROM ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -256,32 +382,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,31 +500,73 @@ FROM ( , subq_12.ds__month , subq_12.ds__quarter , subq_12.ds__year + , subq_12.ds__extract_year + , subq_12.ds__extract_quarter + , subq_12.ds__extract_month + , subq_12.ds__extract_week + , subq_12.ds__extract_day + , subq_12.ds__extract_dayofweek + , subq_12.ds__extract_dayofyear , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month , subq_12.ds_partitioned__quarter , subq_12.ds_partitioned__year + , subq_12.ds_partitioned__extract_year + , subq_12.ds_partitioned__extract_quarter + , subq_12.ds_partitioned__extract_month + , subq_12.ds_partitioned__extract_week + , subq_12.ds_partitioned__extract_day + , subq_12.ds_partitioned__extract_dayofweek + , subq_12.ds_partitioned__extract_dayofyear , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month , subq_12.paid_at__quarter , subq_12.paid_at__year + , subq_12.paid_at__extract_year + , subq_12.paid_at__extract_quarter + , subq_12.paid_at__extract_month + , subq_12.paid_at__extract_week + , subq_12.paid_at__extract_day + , subq_12.paid_at__extract_dayofweek + , subq_12.paid_at__extract_dayofyear , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month , subq_12.booking__ds__quarter , subq_12.booking__ds__year + , subq_12.booking__ds__extract_year + , subq_12.booking__ds__extract_quarter + , subq_12.booking__ds__extract_month + , subq_12.booking__ds__extract_week + , subq_12.booking__ds__extract_day + , subq_12.booking__ds__extract_dayofweek + , subq_12.booking__ds__extract_dayofyear , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month , subq_12.booking__ds_partitioned__quarter , subq_12.booking__ds_partitioned__year + , subq_12.booking__ds_partitioned__extract_year + , subq_12.booking__ds_partitioned__extract_quarter + , subq_12.booking__ds_partitioned__extract_month + , subq_12.booking__ds_partitioned__extract_week + , subq_12.booking__ds_partitioned__extract_day + , subq_12.booking__ds_partitioned__extract_dayofweek + , subq_12.booking__ds_partitioned__extract_dayofyear , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month , subq_12.booking__paid_at__quarter , subq_12.booking__paid_at__year + , subq_12.booking__paid_at__extract_year + , subq_12.booking__paid_at__extract_quarter + , subq_12.booking__paid_at__extract_month + , subq_12.booking__paid_at__extract_week + , subq_12.booking__paid_at__extract_day + , subq_12.booking__paid_at__extract_dayofweek + , subq_12.booking__paid_at__extract_dayofyear , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -406,32 +616,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -480,31 +732,73 @@ FROM ( , subq_17.ds__month , subq_17.ds__quarter , subq_17.ds__year + , subq_17.ds__extract_year + , subq_17.ds__extract_quarter + , subq_17.ds__extract_month + , subq_17.ds__extract_week + , subq_17.ds__extract_day + , subq_17.ds__extract_dayofweek + , subq_17.ds__extract_dayofyear , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month , subq_17.ds_partitioned__quarter , subq_17.ds_partitioned__year + , subq_17.ds_partitioned__extract_year + , subq_17.ds_partitioned__extract_quarter + , subq_17.ds_partitioned__extract_month + , subq_17.ds_partitioned__extract_week + , subq_17.ds_partitioned__extract_day + , subq_17.ds_partitioned__extract_dayofweek + , subq_17.ds_partitioned__extract_dayofyear , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month , subq_17.paid_at__quarter , subq_17.paid_at__year + , subq_17.paid_at__extract_year + , subq_17.paid_at__extract_quarter + , subq_17.paid_at__extract_month + , subq_17.paid_at__extract_week + , subq_17.paid_at__extract_day + , subq_17.paid_at__extract_dayofweek + , subq_17.paid_at__extract_dayofyear , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month , subq_17.booking__ds__quarter , subq_17.booking__ds__year + , subq_17.booking__ds__extract_year + , subq_17.booking__ds__extract_quarter + , subq_17.booking__ds__extract_month + , subq_17.booking__ds__extract_week + , subq_17.booking__ds__extract_day + , subq_17.booking__ds__extract_dayofweek + , subq_17.booking__ds__extract_dayofyear , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month , subq_17.booking__ds_partitioned__quarter , subq_17.booking__ds_partitioned__year + , subq_17.booking__ds_partitioned__extract_year + , subq_17.booking__ds_partitioned__extract_quarter + , subq_17.booking__ds_partitioned__extract_month + , subq_17.booking__ds_partitioned__extract_week + , subq_17.booking__ds_partitioned__extract_day + , subq_17.booking__ds_partitioned__extract_dayofweek + , subq_17.booking__ds_partitioned__extract_dayofyear , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month , subq_17.booking__paid_at__quarter , subq_17.booking__paid_at__year + , subq_17.booking__paid_at__extract_year + , subq_17.booking__paid_at__extract_quarter + , subq_17.booking__paid_at__extract_month + , subq_17.booking__paid_at__extract_week + , subq_17.booking__paid_at__extract_day + , subq_17.booking__paid_at__extract_dayofweek + , subq_17.booking__paid_at__extract_dayofyear , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -554,32 +848,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql index be96decab5..63116a5458 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql @@ -45,32 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql index a5288e7009..a53f3a075b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql @@ -36,21 +36,49 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month , subq_0.verification__ds__quarter , subq_0.verification__ds__year + , subq_0.verification__ds__extract_year + , subq_0.verification__ds__extract_quarter + , subq_0.verification__ds__extract_month + , subq_0.verification__ds__extract_week + , subq_0.verification__ds__extract_day + , subq_0.verification__ds__extract_dayofweek + , subq_0.verification__ds__extract_dayofyear , subq_0.verification__ds_partitioned__day , 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.verification__ds_partitioned__extract_year + , subq_0.verification__ds_partitioned__extract_quarter + , subq_0.verification__ds_partitioned__extract_month + , subq_0.verification__ds_partitioned__extract_week + , subq_0.verification__ds_partitioned__extract_day + , subq_0.verification__ds_partitioned__extract_dayofweek + , subq_0.verification__ds_partitioned__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -71,22 +99,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year + , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -110,32 +166,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year + , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql index c65a58a300..d88d2d32f3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -54,12 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql index 603dac8609..094486f462 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql index adfa1c3f03..a8a26c9899 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 48a1b43de5..c400372dd4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 08a913aa57..30ab4c1851 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -5,11 +5,25 @@ SELECT , subq_0.ds__month AS ds__month , subq_0.ds__quarter AS ds__quarter , subq_0.ds__year AS ds__year + , subq_0.ds__extract_year AS ds__extract_year + , subq_0.ds__extract_quarter AS ds__extract_quarter + , subq_0.ds__extract_month AS ds__extract_month + , subq_0.ds__extract_week AS ds__extract_week + , subq_0.ds__extract_day AS ds__extract_day + , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month , subq_0.account__ds__quarter AS account__ds__quarter , subq_0.account__ds__year AS account__ds__year + , subq_0.account__ds__extract_year AS account__ds__extract_year + , subq_0.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_0.account__ds__extract_month AS account__ds__extract_month + , subq_0.account__ds__extract_week AS account__ds__extract_week + , subq_0.account__ds__extract_day AS account__ds__extract_day + , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -55,12 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year + , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ed796b148d..ef337f422c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -5,11 +5,25 @@ SELECT , subq_3.ds__month AS ds__month , subq_3.ds__quarter AS ds__quarter , subq_3.ds__year AS ds__year + , subq_3.ds__extract_year AS ds__extract_year + , subq_3.ds__extract_quarter AS ds__extract_quarter + , subq_3.ds__extract_month AS ds__extract_month + , subq_3.ds__extract_week AS ds__extract_week + , subq_3.ds__extract_day AS ds__extract_day + , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek + , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month , subq_3.account__ds__quarter AS account__ds__quarter , subq_3.account__ds__year AS account__ds__year + , subq_3.account__ds__extract_year AS account__ds__extract_year + , subq_3.account__ds__extract_quarter AS account__ds__extract_quarter + , subq_3.account__ds__extract_month AS account__ds__extract_month + , subq_3.account__ds__extract_week AS account__ds__extract_week + , subq_3.account__ds__extract_day AS account__ds__extract_day + , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek + , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -28,12 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year + , EXTRACT(YEAR FROM ds) AS account__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS account__ds__extract_month + , EXTRACT(WEEK FROM ds) AS account__ds__extract_week + , EXTRACT(DAY FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql index 782ccc2826..16b897731d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql @@ -31,32 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -83,11 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear , 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 @@ -96,11 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year + , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear , 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 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql index 0f449eb59e..7dd5c3b39d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql index ee19129508..e240956212 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql @@ -20,32 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml index f6e315621f..c0830e210b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml @@ -31,11 +31,11 @@ - + - + @@ -44,7 +44,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -63,11 +63,11 @@ - + - + @@ -76,227 +76,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -313,27 +481,27 @@ - + - + - + - + - + - + @@ -341,31 +509,31 @@ - + - + - + - + - + - + - + @@ -383,133 +551,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -528,11 +864,11 @@ - + - + @@ -541,7 +877,7 @@ - + @@ -550,7 +886,7 @@ - + @@ -560,11 +896,11 @@ - + - + @@ -573,227 +909,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -810,27 +1314,27 @@ - + - + - + - + - + - + @@ -838,31 +1342,31 @@ - + - + - + - + - + - + - + @@ -880,133 +1384,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml index 7a5de1b9b7..34419b3c74 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml @@ -92,27 +92,27 @@ - + - + - + - + - + - + @@ -120,31 +120,31 @@ - + - + - + - + - + - + - + @@ -162,133 +162,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -323,15 +491,15 @@ - + - + - + @@ -349,101 +517,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml index fc211e9645..9315fdef74 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -29,11 +29,11 @@ - + - + @@ -48,15 +48,15 @@ - + - + - + @@ -65,11 +65,11 @@ - + - + @@ -78,11 +78,11 @@ - + - + @@ -92,15 +92,15 @@ - + - + - + @@ -109,19 +109,19 @@ - + - + - + - + @@ -138,15 +138,15 @@ - + - + - + @@ -155,227 +155,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -392,27 +560,27 @@ - + - + - + - + - + - + @@ -420,31 +588,31 @@ - + - + - + - + - + - + - + @@ -462,133 +630,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -607,11 +943,11 @@ - + - + @@ -620,284 +956,508 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -918,15 +1478,15 @@ - + - + - + @@ -935,11 +1495,11 @@ - + - + @@ -948,11 +1508,11 @@ - + - + @@ -962,15 +1522,15 @@ - + - + - + @@ -979,19 +1539,19 @@ - + - + - + - + @@ -1008,15 +1568,15 @@ - + - + - + @@ -1025,123 +1585,235 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1154,7 +1826,7 @@ - + @@ -1172,81 +1844,193 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + @@ -1265,11 +2049,11 @@ - + - + @@ -1278,151 +2062,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1435,15 +2331,15 @@ - + - + - + @@ -1461,101 +2357,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml index 82a0ab149d..95cd7fa4a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml @@ -104,27 +104,27 @@ - + - + - + - + - + - + @@ -132,31 +132,31 @@ - + - + - + - + - + - + - + @@ -174,133 +174,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -335,15 +503,15 @@ - + - + - + @@ -361,101 +529,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml index 38b865d81f..9f5069ebd5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml @@ -92,27 +92,27 @@ - + - + - + - + - + - + @@ -120,31 +120,31 @@ - + - + - + - + - + - + - + @@ -162,133 +162,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -323,15 +491,15 @@ - + - + - + @@ -349,101 +517,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml index aec5366d3c..4dbe746624 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml @@ -62,27 +62,27 @@ - + - + - + - + - + - + @@ -90,31 +90,31 @@ - + - + - + - + - + - + - + @@ -132,133 +132,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml index e821ae326f..767372469e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,75 +49,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -126,11 +182,11 @@ - + - + @@ -148,33 +204,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml index e61cab14ff..0ee72e4356 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,75 +49,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -126,11 +182,11 @@ - + - + @@ -148,33 +204,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml index 5c72bf678b..02d428e68a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml @@ -4,7 +4,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -33,75 +33,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -110,11 +166,11 @@ - + - + @@ -132,33 +188,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml index 2d6d46464a..a5c78af24a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,75 +49,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -126,11 +182,11 @@ - + - + @@ -148,33 +204,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml index 397208997e..836bc1a09c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -50,75 +50,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,75 +183,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -204,11 +316,11 @@ - + - + @@ -226,33 +338,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml index 5ecd845045..db9917690c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -50,75 +50,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,75 +183,131 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -204,11 +316,11 @@ - + - + @@ -226,33 +338,89 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml index e1fff36d2d..47028f82c6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,227 +85,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -322,27 +490,27 @@ - + - + - + - + - + - + @@ -350,31 +518,31 @@ - + - + - + - + - + - + - + @@ -392,133 +560,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -537,11 +873,11 @@ - + - + @@ -550,7 +886,7 @@ - + @@ -559,7 +895,7 @@ - + @@ -569,11 +905,11 @@ - + - + @@ -582,227 +918,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -819,27 +1323,27 @@ - + - + - + - + - + - + @@ -847,31 +1351,31 @@ - + - + - + - + - + - + - + @@ -889,133 +1393,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml index b79bb65ee4..9b112de652 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,227 +85,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -322,27 +490,27 @@ - + - + - + - + - + - + @@ -350,31 +518,31 @@ - + - + - + - + - + - + - + @@ -392,133 +560,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -537,11 +873,11 @@ - + - + @@ -550,7 +886,7 @@ - + @@ -559,7 +895,7 @@ - + @@ -569,11 +905,11 @@ - + - + @@ -582,211 +918,379 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -801,7 +1305,7 @@ - + @@ -816,227 +1320,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1053,27 +1725,27 @@ - + - + - + - + - + - + @@ -1081,31 +1753,31 @@ - + - + - + - + - + - + - + @@ -1123,133 +1795,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml index d83dd52e3e..50437f494c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,227 +85,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -322,27 +490,27 @@ - + - + - + - + - + - + @@ -350,31 +518,31 @@ - + - + - + - + - + - + - + @@ -392,133 +560,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -537,11 +873,11 @@ - + - + @@ -550,7 +886,7 @@ - + @@ -559,7 +895,7 @@ - + @@ -569,11 +905,11 @@ - + - + @@ -586,207 +922,375 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -801,7 +1305,7 @@ - + @@ -816,227 +1320,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1053,27 +1725,27 @@ - + - + - + - + - + - + @@ -1081,31 +1753,31 @@ - + - + - + - + - + - + - + @@ -1123,133 +1795,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml index aaebb9841d..c61572cec8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,227 +85,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -322,27 +490,27 @@ - + - + - + - + - + - + @@ -350,31 +518,31 @@ - + - + - + - + - + - + - + @@ -392,133 +560,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -537,11 +873,11 @@ - + - + @@ -550,7 +886,7 @@ - + @@ -559,7 +895,7 @@ - + @@ -569,11 +905,11 @@ - + - + @@ -582,211 +918,379 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -801,7 +1305,7 @@ - + @@ -816,227 +1320,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1053,27 +1725,27 @@ - + - + - + - + - + - + @@ -1081,31 +1753,31 @@ - + - + - + - + - + - + - + @@ -1123,133 +1795,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml index 3d9f926162..ab7df49f61 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,227 +85,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -322,27 +490,27 @@ - + - + - + - + - + - + @@ -350,31 +518,31 @@ - + - + - + - + - + - + - + @@ -392,133 +560,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -537,11 +873,11 @@ - + - + @@ -550,7 +886,7 @@ - + @@ -559,7 +895,7 @@ - + @@ -569,11 +905,11 @@ - + - + @@ -586,207 +922,375 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -801,7 +1305,7 @@ - + @@ -816,227 +1320,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1053,27 +1725,27 @@ - + - + - + - + - + - + @@ -1081,31 +1753,31 @@ - + - + - + - + - + - + - + @@ -1123,133 +1795,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml index d5bb60eb4f..964ca40404 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,211 +85,379 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -304,7 +472,7 @@ - + @@ -319,227 +487,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -556,27 +892,27 @@ - + - + - + - + - + - + @@ -584,31 +920,31 @@ - + - + - + - + - + - + - + @@ -626,133 +962,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -772,11 +1276,11 @@ - + - + @@ -785,7 +1289,7 @@ - + @@ -794,7 +1298,7 @@ - + @@ -804,11 +1308,11 @@ - + - + @@ -817,211 +1321,379 @@ - + - + - + - + - + - + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1036,7 +1708,7 @@ - + @@ -1051,227 +1723,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1288,27 +2128,27 @@ - + - + - + - + - + - + @@ -1316,31 +2156,31 @@ - + - + - + - + - + - + - + @@ -1358,133 +2198,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml index 5d76366353..bf2ebf93fd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -89,207 +89,375 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -304,7 +472,7 @@ - + @@ -319,227 +487,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -556,27 +892,27 @@ - + - + - + - + - + - + @@ -584,31 +920,31 @@ - + - + - + - + - + - + - + @@ -626,133 +962,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -772,11 +1276,11 @@ - + - + @@ -785,7 +1289,7 @@ - + @@ -794,7 +1298,7 @@ - + @@ -804,11 +1308,11 @@ - + - + @@ -821,207 +1325,375 @@ - + - + - + - + - + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1036,7 +1708,7 @@ - + @@ -1051,227 +1723,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1288,27 +2128,27 @@ - + - + - + - + - + - + @@ -1316,31 +2156,31 @@ - + - + - + - + - + - + - + @@ -1358,133 +2198,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml index 835975e4c7..b4604d9a7a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,211 +62,379 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -281,7 +449,7 @@ - + @@ -296,227 +464,395 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -531,7 +867,7 @@ - + @@ -546,227 +882,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -783,27 +1287,27 @@ - + - + - + - + - + - + @@ -811,31 +1315,31 @@ - + - + - + - + - + - + - + @@ -853,133 +1357,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml index 3cb4bc87d8..edcddda734 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,211 +62,379 @@ - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -281,7 +449,7 @@ - + @@ -296,227 +464,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -533,27 +869,27 @@ - + - + - + - + - + - + @@ -561,31 +897,31 @@ - + - + - + - + - + - + - + @@ -603,133 +939,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml index 0a98623c4d..07444a9b99 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml @@ -4,13 +4,13 @@ - + - + @@ -19,7 +19,7 @@ - + @@ -28,11 +28,11 @@ - + - + @@ -41,7 +41,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -60,11 +60,11 @@ - + - + @@ -73,15 +73,15 @@ - + - + - + @@ -98,11 +98,11 @@ - + - + @@ -111,227 +111,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -348,27 +516,27 @@ - + - + - + - + - + - + @@ -376,31 +544,31 @@ - + - + - + - + - + - + - + @@ -418,133 +586,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -563,11 +899,11 @@ - + - + @@ -576,151 +912,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -733,15 +1181,15 @@ - + - + - + @@ -759,101 +1207,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml index e6bdd09af0..fcfe3e55b0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml @@ -23,27 +23,27 @@ - + - + - + - + - + - + @@ -51,31 +51,31 @@ - + - + - + - + - + - + - + @@ -93,133 +93,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml index be8b76158e..3588eccfef 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml @@ -41,27 +41,27 @@ - + - + - + - + - + - + @@ -69,31 +69,31 @@ - + - + - + - + - + - + - + @@ -111,133 +111,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml index 5cfd7e07dd..38e7f01169 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,15 +49,15 @@ - + - + - + @@ -69,15 +69,15 @@ - + - + - + @@ -86,19 +86,19 @@ - + - + - + - + @@ -115,15 +115,15 @@ - + - + - + @@ -132,227 +132,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -369,27 +537,27 @@ - + - + - + - + - + - + @@ -397,31 +565,31 @@ - + - + - + - + - + - + - + @@ -439,133 +607,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -584,11 +920,11 @@ - + - + @@ -597,151 +933,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -754,15 +1202,15 @@ - + - + - + @@ -780,101 +1228,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml index 039becd5f3..bc1b1e86fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,15 +49,15 @@ - + - + - + @@ -69,15 +69,15 @@ - + - + - + @@ -86,27 +86,27 @@ - + - - - - + + + + - + - + - + - + @@ -123,15 +123,15 @@ - + - + - + @@ -140,203 +140,371 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -353,27 +521,27 @@ - + - + - + - + - + - + @@ -391,141 +559,309 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -544,19 +880,19 @@ - - + + - + - + - + @@ -565,7 +901,7 @@ - + @@ -583,101 +919,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml index e97315791a..d707b51e98 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml @@ -2,18 +2,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -25,10 +25,10 @@ - - - - + + + + @@ -40,14 +40,14 @@ - - - - - - - - + + + + + + + + @@ -57,27 +57,27 @@ - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + @@ -86,15 +86,15 @@ - + - - - - + + + + - + @@ -124,204 +124,372 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -340,27 +508,27 @@ - + - + - + - + - + - + @@ -368,31 +536,31 @@ - + - + - + - + - + - + - + @@ -410,133 +578,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml index e97315791a..d707b51e98 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml @@ -2,18 +2,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -25,10 +25,10 @@ - - - - + + + + @@ -40,14 +40,14 @@ - - - - - - - - + + + + + + + + @@ -57,27 +57,27 @@ - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + @@ -86,15 +86,15 @@ - + - - - - + + + + - + @@ -124,204 +124,372 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -340,27 +508,27 @@ - + - + - + - + - + - + @@ -368,31 +536,31 @@ - + - + - + - + - + - + - + @@ -410,133 +578,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml index e97315791a..d707b51e98 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml @@ -2,18 +2,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + @@ -25,10 +25,10 @@ - - - - + + + + @@ -40,14 +40,14 @@ - - - - - - - - + + + + + + + + @@ -57,27 +57,27 @@ - - - - - - - - + + + + + + + + - - - - - - - - + + + + + + + + @@ -86,15 +86,15 @@ - + - - - - + + + + - + @@ -124,204 +124,372 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -340,27 +508,27 @@ - + - + - + - + - + - + @@ -368,31 +536,31 @@ - + - + - + - + - + - + - + @@ -410,133 +578,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml index 2ad699be1e..eb918937d1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,227 +62,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -299,27 +467,27 @@ - + - + - + - + - + - + @@ -327,31 +495,31 @@ - + - + - + - + - + - + - + @@ -369,133 +537,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml index 6d1aa61883..0c406fa13f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,151 +49,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -206,15 +318,15 @@ - + - + - + @@ -232,101 +344,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml index 6f19ddfe1f..aa58e56a77 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml @@ -56,27 +56,27 @@ - + - + - + - + - + - + @@ -84,31 +84,31 @@ - + - + - + - + - + - + - + @@ -126,133 +126,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml index 286024abca..861a4944cd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,15 +21,15 @@ - + - + - + @@ -50,11 +50,11 @@ - + - + @@ -63,7 +63,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -82,11 +82,11 @@ - + - + @@ -95,15 +95,15 @@ - + - + - + @@ -115,15 +115,15 @@ - + - + - + @@ -132,19 +132,19 @@ - + - + - + - + @@ -161,15 +161,15 @@ - + - + - + @@ -178,227 +178,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -415,27 +583,27 @@ - + - + - + - + - + - + @@ -443,31 +611,31 @@ - + - + - + - + - + - + - + @@ -485,133 +653,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -630,11 +966,11 @@ - + - + @@ -643,151 +979,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -800,15 +1248,15 @@ - + - + - + @@ -826,101 +1274,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -943,11 +1503,11 @@ - + - + @@ -956,7 +1516,7 @@ - + @@ -965,7 +1525,7 @@ - + @@ -975,11 +1535,11 @@ - + - + @@ -988,15 +1548,15 @@ - + - + - + @@ -1008,15 +1568,15 @@ - + - + - + @@ -1025,19 +1585,19 @@ - + - + - + - + @@ -1054,15 +1614,15 @@ - + - + - + @@ -1071,227 +1631,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1308,27 +2036,27 @@ - + - + - + - + - + - + @@ -1336,31 +2064,31 @@ - + - + - + - + - + - + - + @@ -1378,133 +2106,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -1523,11 +2419,11 @@ - + - + @@ -1536,151 +2432,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1693,15 +2701,15 @@ - + - + - + @@ -1719,101 +2727,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -1836,11 +2956,11 @@ - + - + @@ -1849,7 +2969,7 @@ - + @@ -1858,7 +2978,7 @@ - + @@ -1868,11 +2988,11 @@ - + - + @@ -1881,227 +3001,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -2118,27 +3406,27 @@ - + - + - + - + - + - + @@ -2146,31 +3434,31 @@ - + - + - + - + - + - + - + @@ -2188,133 +3476,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml index 7ac1680f62..44372c125e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,15 +85,15 @@ - + - + - + @@ -105,15 +105,15 @@ - + - + - + @@ -122,227 +122,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -359,27 +527,27 @@ - + - + - + - + - + - + @@ -387,31 +555,31 @@ - + - + - + - + - + - + - + @@ -429,133 +597,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -576,11 +912,11 @@ - + - + @@ -589,7 +925,7 @@ - + @@ -598,7 +934,7 @@ - + @@ -608,11 +944,11 @@ - + - + @@ -621,227 +957,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -858,27 +1362,27 @@ - + - + - + - + - + - + @@ -886,31 +1390,31 @@ - + - + - + - + - + - + - + @@ -928,133 +1432,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml index cf76b6c264..c22e5aaa2c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml @@ -4,7 +4,7 @@ - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,15 +62,15 @@ - + - + - + @@ -82,15 +82,15 @@ - + - + - + @@ -99,227 +99,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -336,27 +504,27 @@ - + - + - + - + - + - + @@ -364,31 +532,31 @@ - + - + - + - + - + - + - + @@ -406,133 +574,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml index bc37ee4ba5..700630d85f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml @@ -13,11 +13,11 @@ - + - + @@ -32,7 +32,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -61,227 +61,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -298,27 +466,27 @@ - + - + - + - + - + - + @@ -326,31 +494,31 @@ - + - + - + - + - + - + - + @@ -368,133 +536,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -513,7 +849,7 @@ - + @@ -533,7 +869,7 @@ - + @@ -542,151 +878,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -699,15 +1147,15 @@ - + - + - + @@ -725,101 +1173,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml index 61d600e32e..0925971c02 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -21,11 +21,11 @@ - + - + @@ -34,11 +34,11 @@ - + - + @@ -48,15 +48,15 @@ - + - + - + @@ -65,27 +65,27 @@ - + - - - - + + + + - + - + - + - + @@ -102,15 +102,15 @@ - + - + - + @@ -119,203 +119,371 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -332,27 +500,27 @@ - + - + - + - + - + - + @@ -370,141 +538,309 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -523,19 +859,19 @@ - - + + - + - + - + @@ -544,143 +880,283 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + @@ -695,7 +1171,7 @@ - + @@ -713,101 +1189,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + @@ -827,64 +1415,134 @@ + + + + + + + + + + + + + + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -893,7 +1551,7 @@ - + @@ -911,37 +1569,93 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml index af8393dcd6..e26de6a7d9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -21,11 +21,11 @@ - + - + @@ -34,11 +34,11 @@ - + - + @@ -48,15 +48,15 @@ - + - + - + @@ -65,27 +65,27 @@ - + - - - - - - - - + + + + + + + + - + - + - + @@ -102,15 +102,15 @@ - + - + - + @@ -119,203 +119,371 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -332,27 +500,27 @@ - + - + - + - + - + - + @@ -370,141 +538,309 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -524,21 +860,21 @@ - - - - - - - - + + + + + + + + - + - + @@ -547,59 +883,115 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + @@ -614,15 +1006,15 @@ - + - + - + @@ -643,114 +1035,254 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -759,7 +1291,7 @@ - + @@ -777,77 +1309,189 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml index dfaf625e64..86c66d0258 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml @@ -60,27 +60,27 @@ - + - + - + - + - + - + @@ -88,31 +88,31 @@ - + - + - + - + - + - + - + @@ -130,133 +130,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -291,15 +459,15 @@ - + - + - + @@ -317,101 +485,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -446,15 +726,15 @@ - + - + - + @@ -472,101 +752,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml index c6279b9625..9f9193531e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,23 +49,23 @@ - + - + - + - + - + @@ -82,137 +82,249 @@ - + - + - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -220,11 +332,11 @@ - + - + @@ -242,77 +354,189 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -331,15 +555,15 @@ - + - + - + @@ -348,91 +572,175 @@ - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -447,11 +755,11 @@ - + - + @@ -469,41 +777,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -525,72 +889,142 @@ + + + + + + + + + + + + + + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + @@ -599,15 +1033,15 @@ - + - + - + @@ -625,37 +1059,93 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml index 93e976b5aa..cbd37b5a97 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml @@ -23,7 +23,7 @@ - + @@ -43,7 +43,7 @@ - + @@ -53,227 +53,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -282,227 +450,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -519,27 +855,27 @@ - + - + - + - + - + - + @@ -547,31 +883,31 @@ - + - + - + - + - + - + - + @@ -589,133 +925,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -733,10 +1237,10 @@ - - - - + + + + @@ -753,164 +1257,276 @@ - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -918,151 +1534,263 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1075,15 +1803,15 @@ - + - + - + @@ -1101,101 +1829,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml index 5ad4e40835..ebf9d2d655 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,15 +21,15 @@ - + - + - + @@ -50,7 +50,7 @@ - + @@ -67,11 +67,11 @@ - + - + @@ -86,11 +86,11 @@ - + - + @@ -99,7 +99,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -118,11 +118,11 @@ - + - + @@ -131,227 +131,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -368,27 +536,27 @@ - + - + - + - + - + - + @@ -396,31 +564,31 @@ - + - + - + - + - + - + - + @@ -438,133 +606,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -583,11 +919,11 @@ - + - + @@ -596,7 +932,7 @@ - + @@ -605,7 +941,7 @@ - + @@ -615,11 +951,11 @@ - + - + @@ -628,227 +964,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -865,27 +1369,27 @@ - + - + - + - + - + - + @@ -893,31 +1397,31 @@ - + - + - + - + - + - + - + @@ -935,133 +1439,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -1082,11 +1754,11 @@ - + - + @@ -1095,7 +1767,7 @@ - + @@ -1104,7 +1776,7 @@ - + @@ -1114,11 +1786,11 @@ - + - + @@ -1127,227 +1799,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + - - - + + + - - - + + + - + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1364,27 +2204,27 @@ - + - + - + - + - + - + @@ -1392,31 +2232,31 @@ - + - + - + - + - + - + - + @@ -1434,133 +2274,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -1579,11 +2587,11 @@ - + - + @@ -1592,7 +2600,7 @@ - + @@ -1601,7 +2609,7 @@ - + @@ -1611,11 +2619,11 @@ - + - + @@ -1624,227 +2632,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -1861,27 +3037,27 @@ - + - + - + - + - + - + @@ -1889,31 +3065,31 @@ - + - + - + - + - + - + - + @@ -1931,133 +3107,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml index 8a1b7def27..dd1374fbd4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml @@ -98,27 +98,27 @@ - + - + - + - + - + - + @@ -126,31 +126,31 @@ - + - + - + - + - + - + - + @@ -168,133 +168,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml index 26789f01a6..175032c65b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,23 +49,23 @@ - + - + - + - + - + @@ -82,15 +82,15 @@ - + - + - + @@ -99,127 +99,239 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -232,7 +344,7 @@ - + @@ -250,85 +362,197 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + @@ -347,15 +571,15 @@ - + - + - + @@ -364,7 +588,7 @@ - + @@ -382,117 +606,285 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml index ea9d4375ce..132ec029e6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml @@ -25,48 +25,104 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -113,41 +169,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -201,41 +313,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml index e3e3940b46..cceeec487f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml @@ -25,48 +25,104 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -113,41 +169,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -209,41 +321,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml index 22a9628ef1..f030246e44 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml @@ -25,48 +25,104 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -113,41 +169,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + @@ -209,41 +321,97 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml index 23bf64d5f1..e1cc885427 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml @@ -46,27 +46,27 @@ - + - + - + - + - + - + @@ -74,31 +74,31 @@ - + - + - + - + - + - + - + @@ -116,133 +116,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -277,15 +445,15 @@ - + - + - + @@ -303,101 +471,213 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml index 9b0610cf8b..c497bc5f85 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml @@ -12,27 +12,27 @@ - + - + - + - + - + - + @@ -40,31 +40,31 @@ - + - + - + - + - + - + - + @@ -82,133 +82,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 0438bcd3c2..343e8eb274 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -67,32 +109,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index be6e7930be..6e9ffdb258 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month , DATE_TRUNC(paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month , DATE_TRUNC(ds, quarter) AS booking__ds__quarter , DATE_TRUNC(ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month , DATE_TRUNC(paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , paid_at AS metric_time__day , DATE_TRUNC(paid_at, isoweek) AS metric_time__week , DATE_TRUNC(paid_at, month) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index dfebc400e0..1d6c177790 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -79,32 +121,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index d014cb232e..ac5f560577 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month , DATE_TRUNC(paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month , DATE_TRUNC(ds, quarter) AS booking__ds__quarter , DATE_TRUNC(ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month , DATE_TRUNC(paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , ds AS metric_time__day , DATE_TRUNC(ds, isoweek) AS metric_time__week , DATE_TRUNC(ds, month) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql index da1967d18d..95a2765eec 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -227,32 +353,74 @@ FULL OUTER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index d85b98c372..7546e82b35 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -67,32 +109,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/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/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 8f68ad52d4..dd88a042dc 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/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/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS booking__paid_at__extract_dayofyear , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 7c20f14f7c..e3908e0d03 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -79,32 +121,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 7c661d75a0..e739399f60 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS booking__paid_at__extract_dayofyear , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql index 4141b83082..08e9c6f6fa 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -227,32 +353,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index d85b98c372..4f359630e6 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -67,32 +109,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 8f68ad52d4..ed2c8def7c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 7c20f14f7c..3acc2d08e5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -79,32 +121,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 7c661d75a0..541c754a5a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql index 4141b83082..9a64eefccb 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -227,32 +353,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index d85b98c372..4f359630e6 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -67,32 +109,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/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/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 8f68ad52d4..ed2c8def7c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/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/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 7c20f14f7c..3acc2d08e5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -79,32 +121,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 7c661d75a0..541c754a5a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql index 4141b83082..9a64eefccb 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -227,32 +353,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index d85b98c372..4f359630e6 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -67,32 +109,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/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/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 8f68ad52d4..ed2c8def7c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/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/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 7c20f14f7c..3acc2d08e5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -79,32 +121,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 7c661d75a0..541c754a5a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql index 4141b83082..9a64eefccb 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -227,32 +353,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index d85b98c372..4f359630e6 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -67,32 +109,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/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/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 8f68ad52d4..ed2c8def7c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/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/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 7c20f14f7c..3acc2d08e5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -5,31 +5,73 @@ SELECT , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -79,32 +121,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 7c661d75a0..541c754a5a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,31 +6,73 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year + , EXTRACT(YEAR FROM ds) AS ds__extract_year + , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS ds__extract_month + , EXTRACT(WEEK FROM ds) AS ds__extract_week + , EXTRACT(DAY FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year + , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year + , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql index 4141b83082..9a64eefccb 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql @@ -27,31 +27,73 @@ FROM ( , subq_0.ds__month , subq_0.ds__quarter , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dayofweek + , subq_0.ds__extract_dayofyear , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month , subq_0.ds_partitioned__quarter , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dayofweek + , subq_0.ds_partitioned__extract_dayofyear , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month , subq_0.paid_at__quarter , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dayofweek + , subq_0.paid_at__extract_dayofyear , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month , subq_0.booking__ds__quarter , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dayofweek + , subq_0.booking__ds__extract_dayofyear , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month , subq_0.booking__ds_partitioned__quarter , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dayofweek + , subq_0.booking__ds_partitioned__extract_dayofyear , subq_0.booking__paid_at__day , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dayofweek + , subq_0.booking__paid_at__extract_dayofyear , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -101,32 +143,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -165,31 +249,73 @@ FULL OUTER JOIN ( , subq_5.ds__month , subq_5.ds__quarter , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dayofweek + , subq_5.ds__extract_dayofyear , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month , subq_5.ds_partitioned__quarter , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dayofweek + , subq_5.ds_partitioned__extract_dayofyear , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month , subq_5.paid_at__quarter , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dayofweek + , subq_5.paid_at__extract_dayofyear , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month , subq_5.booking__ds__quarter , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dayofweek + , subq_5.booking__ds__extract_dayofyear , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month , subq_5.booking__ds_partitioned__quarter , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dayofweek + , subq_5.booking__ds_partitioned__extract_dayofyear , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month , subq_5.booking__paid_at__quarter , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dayofweek + , subq_5.booking__paid_at__extract_dayofyear , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -227,32 +353,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml index 472402b294..c9e54613ef 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml @@ -25,156 +25,324 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + @@ -193,27 +361,27 @@ - + - + - + - + - + - + @@ -221,31 +389,31 @@ - + - + - + - + - + - + - + @@ -263,133 +431,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml index 6064b575cc..e540f55e93 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml @@ -25,204 +25,372 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -241,27 +409,27 @@ - + - + - + - + - + - + @@ -269,31 +437,31 @@ - + - + - + - + - + - + - + @@ -311,133 +479,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml index 612b73007d..14997b6627 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml @@ -31,11 +31,11 @@ - + - + @@ -44,7 +44,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -63,11 +63,11 @@ - + - + @@ -76,227 +76,395 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + @@ -313,27 +481,27 @@ - + - + - + - + - + - + @@ -341,31 +509,31 @@ - + - + - + - + - + - + - + @@ -383,133 +551,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + @@ -528,11 +864,11 @@ - + - + @@ -541,7 +877,7 @@ - + @@ -550,7 +886,7 @@ - + @@ -560,11 +896,11 @@ - + - + @@ -573,179 +909,347 @@ - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -762,27 +1266,27 @@ - + - + - + - + - + - + @@ -790,31 +1294,31 @@ - + - + - + - + - + - + - + @@ -832,133 +1336,301 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml index ff4e3095e1..fea487abac 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfp_0.xml @@ -34,6 +34,7 @@ + @@ -65,6 +66,7 @@ + @@ -132,6 +134,7 @@ + @@ -163,6 +166,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfpo_0.xml index 567f1b3146..3b32bfb08a 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_1_semantic_model__dfpo_0.xml @@ -40,6 +40,7 @@ + @@ -75,6 +76,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml index 6e1d6b4714..e77cb19195 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfp_0.xml @@ -34,6 +34,7 @@ + @@ -77,6 +78,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfpo_0.xml index 34e73d06a2..d3ee23ea35 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_metrics_from_2_semantic_models__dfpo_0.xml @@ -34,6 +34,7 @@ + @@ -77,6 +78,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml index 1f42c277f8..01ba8a68c5 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfp_0.xml @@ -48,6 +48,7 @@ + @@ -91,6 +92,7 @@ + @@ -150,6 +152,7 @@ + @@ -193,6 +196,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfpo_0.xml index d8a77edaeb..defb580aff 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_2_ratio_metrics_from_1_semantic_model__dfpo_0.xml @@ -75,6 +75,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml index 9475198ca2..59589a8c8a 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfp_0.xml @@ -34,6 +34,7 @@ + @@ -77,6 +78,7 @@ + @@ -120,6 +122,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfpo_0.xml index 0b0f3c1d06..7b4e7ec6e8 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_3_metrics_from_2_semantic_models__dfpo_0.xml @@ -45,6 +45,7 @@ + @@ -88,6 +89,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml index 8b2fc3bdcb..9003e62d30 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -120,6 +122,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml index 5985e50ac7..eeaa437cc5 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml @@ -34,6 +34,7 @@ + @@ -87,6 +88,7 @@ + @@ -120,6 +122,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml index 8f72acf134..8d663c8802 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfp_0.xml @@ -43,6 +43,7 @@ + @@ -86,6 +87,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfpo_0.xml index 0892b0a651..97636fa2d4 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric__dfpo_0.xml @@ -50,6 +50,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml index fe405e35b4..2a8cc7308e 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfp_0.xml @@ -34,6 +34,7 @@ + @@ -91,6 +92,7 @@ + @@ -134,6 +136,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfpo_0.xml index 4236d7a342..8286ae3ddb 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_derived_metric_with_non_derived_metric__dfpo_0.xml @@ -34,6 +34,7 @@ + @@ -98,6 +99,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml index 94e4d36375..a7b7790b04 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfp_0.xml @@ -57,6 +57,7 @@ + @@ -100,6 +101,7 @@ + @@ -145,6 +147,7 @@ + @@ -188,6 +191,7 @@ + diff --git a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfpo_0.xml b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfpo_0.xml index 294f42931e..74c85eef7a 100644 --- a/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfpo_0.xml +++ b/metricflow/test/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_nested_derived_metric__dfpo_0.xml @@ -64,6 +64,7 @@ + @@ -119,6 +120,7 @@ + diff --git a/metricflow/time/date_part.py b/metricflow/time/date_part.py new file mode 100644 index 0000000000..b6ccea9172 --- /dev/null +++ b/metricflow/time/date_part.py @@ -0,0 +1,40 @@ +from __future__ import annotations + +from enum import Enum + +from dbt_semantic_interfaces.enum_extension import assert_values_exhausted +from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity + + +class DatePart(Enum): + """Date parts able to be extracted from a time dimension. + + TODO: add support for hour, minute, second once those granularities are available + """ + + YEAR = "year" + QUARTER = "quarter" + MONTH = "month" + WEEK = "week" + DAY = "day" + DAYOFWEEK = "dayofweek" + DAYOFYEAR = "dayofyear" + + def to_int(self) -> int: + """Convert to an int so that the size of the granularity can be easily compared.""" + if self is DatePart.DAY: + return TimeGranularity.DAY.to_int() + elif self is DatePart.DAYOFWEEK: + return TimeGranularity.DAY.to_int() + elif self is DatePart.DAYOFYEAR: + return TimeGranularity.DAY.to_int() + elif self is DatePart.WEEK: + return TimeGranularity.WEEK.to_int() + elif self is DatePart.MONTH: + return TimeGranularity.MONTH.to_int() + elif self is DatePart.QUARTER: + return TimeGranularity.QUARTER.to_int() + elif self is DatePart.YEAR: + return TimeGranularity.YEAR.to_int() + else: + assert_values_exhausted(self) diff --git a/metricflow/time/time_granularity.py b/metricflow/time/time_granularity.py index a08beb2431..c96909d375 100644 --- a/metricflow/time/time_granularity.py +++ b/metricflow/time/time_granularity.py @@ -36,7 +36,7 @@ def is_period_start(time_granularity: TimeGranularity, date: Union[pd.Timestamp, if time_granularity is TimeGranularity.DAY: return True elif time_granularity is TimeGranularity.WEEK: - return ISOWeekDay.from_pandas_timestamp(pd_date).is_week_start + return ISODAYOFWEEK.from_pandas_timestamp(pd_date).is_week_start elif time_granularity is TimeGranularity.MONTH: return pd_date.is_month_start elif time_granularity is TimeGranularity.QUARTER: @@ -53,7 +53,7 @@ def is_period_end(time_granularity: TimeGranularity, date: Union[pd.Timestamp, d if time_granularity is TimeGranularity.DAY: return True elif time_granularity is TimeGranularity.WEEK: - return ISOWeekDay.from_pandas_timestamp(pd_date).is_week_end + return ISODAYOFWEEK.from_pandas_timestamp(pd_date).is_week_end elif time_granularity is TimeGranularity.MONTH: return pd_date.is_month_end elif time_granularity is TimeGranularity.QUARTER: @@ -70,7 +70,7 @@ def period_begin_offset( # noqa: D if time_granularity is TimeGranularity.DAY: raise ValueError(f"Can't get period start offset for TimeGranularity.{time_granularity.name}.") elif time_granularity is TimeGranularity.WEEK: - return pd.offsets.Week(weekday=ISOWeekDay.MONDAY.pandas_value) + return pd.offsets.Week(dayofweek=ISODAYOFWEEK.MONDAY.pandas_value) elif time_granularity is TimeGranularity.MONTH: return pd.offsets.MonthBegin() elif time_granularity is TimeGranularity.QUARTER: @@ -87,7 +87,7 @@ def period_end_offset( # noqa: D if time_granularity is TimeGranularity.DAY: raise ValueError(f"Can't get period end offset for TimeGranularity.{time_granularity.name}.") elif time_granularity == TimeGranularity.WEEK: - return pd.offsets.Week(weekday=ISOWeekDay.SUNDAY.pandas_value) + return pd.offsets.Week(dayofweek=ISODAYOFWEEK.SUNDAY.pandas_value) elif time_granularity is TimeGranularity.MONTH: return pd.offsets.MonthEnd() elif time_granularity is TimeGranularity.QUARTER: @@ -132,7 +132,7 @@ def match_start_or_end_of_period( ) -class ISOWeekDay(ExtendedEnum): +class ISODAYOFWEEK(ExtendedEnum): """Day of week values per ISO standard.""" MONDAY = 1 @@ -144,23 +144,23 @@ class ISOWeekDay(ExtendedEnum): SUNDAY = 7 @staticmethod - def from_pandas_timestamp(timestamp: pd.Timestamp) -> ISOWeekDay: - """Factory for streamlining conversion from a Pandas Timestamp to an ISOWeekDay.""" - return ISOWeekDay(timestamp.isoweekday()) + def from_pandas_timestamp(timestamp: pd.Timestamp) -> ISODAYOFWEEK: + """Factory for streamlining conversion from a Pandas Timestamp to an ISODAYOFWEEK.""" + return ISODAYOFWEEK(timestamp.isodayofweek()) @property def is_week_start(self) -> bool: """Return comparison of instance value against ISO standard start of week (Monday).""" - return self is ISOWeekDay.MONDAY + return self is ISODAYOFWEEK.MONDAY @property def is_week_end(self) -> bool: """Return comparison of instance value against ISO standard end of week (Sunday).""" - return self is ISOWeekDay.SUNDAY + return self is ISODAYOFWEEK.SUNDAY @property def pandas_value(self) -> int: - """Returns the pandas int value representation of the ISOWeekDay.""" + """Returns the pandas int value representation of the ISODAYOFWEEK.""" return self.value - 1 From bf5f61ccc207d87f16390c5b1320a27182632fc8 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 13:43:49 -0700 Subject: [PATCH 02/15] Accept date_part in query params --- metricflow/dataset/dataset.py | 8 +- metricflow/naming/linkable_spec_name.py | 8 +- metricflow/plan_conversion/dataflow_to_sql.py | 4 +- .../plan_conversion/instance_converters.py | 10 +- metricflow/query/query_parser.py | 3 +- metricflow/specs/query_interface.py | 12 + metricflow/specs/where_filter_dimension.py | 4 + metricflow/specs/where_filter_entity.py | 6 +- .../specs/where_filter_time_dimension.py | 12 +- .../integration/test_cases/itest_metrics.yaml | 14 + metricflow/test/query/test_query_parser.py | 1 + .../test_common_semantic_model__plan0.sql | 14 + ...o_from_multiple_semantic_models__plan0.sql | 28 + .../test_cumulative_metric__plan0.sql | 7 + ...cumulative_metric_grain_to_date__plan0.sql | 7 + .../test_cumulative_metric_no_ds__plan0.sql | 7 + ...est_cumulative_metric_no_window__plan0.sql | 7 + ..._no_window_with_time_constraint__plan0.sql | 14 + ...ive_metric_with_time_constraint__plan0.sql | 14 + .../BigQuery/test_derived_metric__plan0.sql | 14 + ...ved_metric_with_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...rived_metric_with_offset_window__plan0.sql | 14 + ...h_offset_window_and_granularity__plan0.sql | 14 + ...fset_window_and_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...erived_offset_cumulative_metric__plan0.sql | 14 + ...et_metric_with_one_input_metric__plan0.sql | 7 + .../BigQuery/test_distinct_values__plan0.sql | 14 + ...th_where_constraint_on_join_dim__plan0.sql | 14 + .../test_join_to_scd_dimension__plan0.sql | 21 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 7 + ...e_spine_node_with_offset_window__plan0.sql | 7 + ..._time_spine_node_without_offset__plan0.sql | 7 + .../BigQuery/test_limit_rows__plan0.sql | 7 + ...al_dimension_using_local_entity__plan0.sql | 7 + .../test_measure_constraint__plan0.sql | 35 + ..._constraint_with_reused_measure__plan0.sql | 14 + ...aint_with_single_expr_and_alias__plan0.sql | 7 + ..._multiple_sources_no_dimensions__plan0.sql | 14 + ...multi_hop_through_scd_dimension__plan0.sql | 21 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 13 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 4 +- .../BigQuery/test_multihop_node__plan0.sql | 7 + ..._multiple_metrics_no_dimensions__plan0.sql | 28 + .../test_nested_derived_metric__plan0.sql | 28 + .../BigQuery/test_partitioned_join__plan0.sql | 7 + .../test_common_semantic_model__plan0.sql | 14 + ...o_from_multiple_semantic_models__plan0.sql | 28 + .../test_cumulative_metric__plan0.sql | 7 + ...cumulative_metric_grain_to_date__plan0.sql | 7 + .../test_cumulative_metric_no_ds__plan0.sql | 7 + ...est_cumulative_metric_no_window__plan0.sql | 7 + ..._no_window_with_time_constraint__plan0.sql | 14 + ...ive_metric_with_time_constraint__plan0.sql | 14 + .../Databricks/test_derived_metric__plan0.sql | 14 + ...ved_metric_with_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...rived_metric_with_offset_window__plan0.sql | 14 + ...h_offset_window_and_granularity__plan0.sql | 14 + ...fset_window_and_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...erived_offset_cumulative_metric__plan0.sql | 14 + ...et_metric_with_one_input_metric__plan0.sql | 7 + .../test_distinct_values__plan0.sql | 14 + ...th_where_constraint_on_join_dim__plan0.sql | 14 + .../test_join_to_scd_dimension__plan0.sql | 21 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 7 + ...e_spine_node_with_offset_window__plan0.sql | 7 + ..._time_spine_node_without_offset__plan0.sql | 7 + .../Databricks/test_limit_rows__plan0.sql | 7 + ...al_dimension_using_local_entity__plan0.sql | 7 + .../test_measure_constraint__plan0.sql | 35 + ..._constraint_with_reused_measure__plan0.sql | 14 + ...aint_with_single_expr_and_alias__plan0.sql | 7 + ..._multiple_sources_no_dimensions__plan0.sql | 14 + ...multi_hop_through_scd_dimension__plan0.sql | 21 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 13 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 4 +- .../Databricks/test_multihop_node__plan0.sql | 7 + ..._multiple_metrics_no_dimensions__plan0.sql | 28 + .../test_nested_derived_metric__plan0.sql | 28 + .../test_partitioned_join__plan0.sql | 7 + .../test_common_semantic_model__plan0.sql | 14 + ...o_from_multiple_semantic_models__plan0.sql | 28 + .../DuckDB/test_cumulative_metric__plan0.sql | 7 + ...cumulative_metric_grain_to_date__plan0.sql | 7 + .../test_cumulative_metric_no_ds__plan0.sql | 7 + ...est_cumulative_metric_no_window__plan0.sql | 7 + ..._no_window_with_time_constraint__plan0.sql | 14 + ...ive_metric_with_time_constraint__plan0.sql | 14 + .../DuckDB/test_derived_metric__plan0.sql | 14 + ...ved_metric_with_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...rived_metric_with_offset_window__plan0.sql | 14 + ...h_offset_window_and_granularity__plan0.sql | 14 + ...fset_window_and_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...erived_offset_cumulative_metric__plan0.sql | 14 + ...et_metric_with_one_input_metric__plan0.sql | 7 + .../DuckDB/test_distinct_values__plan0.sql | 14 + ...th_where_constraint_on_join_dim__plan0.sql | 14 + .../test_join_to_scd_dimension__plan0.sql | 21 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 7 + ...e_spine_node_with_offset_window__plan0.sql | 7 + ..._time_spine_node_without_offset__plan0.sql | 7 + .../DuckDB/test_limit_rows__plan0.sql | 7 + ...al_dimension_using_local_entity__plan0.sql | 7 + .../DuckDB/test_measure_constraint__plan0.sql | 35 + ..._constraint_with_reused_measure__plan0.sql | 14 + ...aint_with_single_expr_and_alias__plan0.sql | 7 + ..._multiple_sources_no_dimensions__plan0.sql | 14 + ...multi_hop_through_scd_dimension__plan0.sql | 21 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 15 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 6 +- .../DuckDB/test_multihop_node__plan0.sql | 7 + ..._multiple_metrics_no_dimensions__plan0.sql | 28 + .../test_nested_derived_metric__plan0.sql | 28 + .../DuckDB/test_partitioned_join__plan0.sql | 7 + .../test_common_semantic_model__plan0.sql | 14 + ...o_from_multiple_semantic_models__plan0.sql | 28 + .../test_cumulative_metric__plan0.sql | 7 + ...cumulative_metric_grain_to_date__plan0.sql | 7 + .../test_cumulative_metric_no_ds__plan0.sql | 7 + ...est_cumulative_metric_no_window__plan0.sql | 7 + ..._no_window_with_time_constraint__plan0.sql | 14 + ...ive_metric_with_time_constraint__plan0.sql | 14 + .../Postgres/test_derived_metric__plan0.sql | 14 + ...ved_metric_with_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...rived_metric_with_offset_window__plan0.sql | 14 + ...h_offset_window_and_granularity__plan0.sql | 14 + ...fset_window_and_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...erived_offset_cumulative_metric__plan0.sql | 14 + ...et_metric_with_one_input_metric__plan0.sql | 7 + .../Postgres/test_distinct_values__plan0.sql | 14 + ...th_where_constraint_on_join_dim__plan0.sql | 14 + .../test_join_to_scd_dimension__plan0.sql | 21 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 7 + ...e_spine_node_with_offset_window__plan0.sql | 7 + ..._time_spine_node_without_offset__plan0.sql | 7 + .../Postgres/test_limit_rows__plan0.sql | 7 + ...al_dimension_using_local_entity__plan0.sql | 7 + .../test_measure_constraint__plan0.sql | 35 + ..._constraint_with_reused_measure__plan0.sql | 14 + ...aint_with_single_expr_and_alias__plan0.sql | 7 + ..._multiple_sources_no_dimensions__plan0.sql | 14 + ...multi_hop_through_scd_dimension__plan0.sql | 13 +- ...through_scd_dimension__plan0_optimized.sql | 4 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 7 + .../Postgres/test_multihop_node__plan0.sql | 7 + ..._multiple_metrics_no_dimensions__plan0.sql | 28 + .../test_nested_derived_metric__plan0.sql | 28 + .../Postgres/test_partitioned_join__plan0.sql | 7 + .../test_common_semantic_model__plan0.sql | 14 + ...o_from_multiple_semantic_models__plan0.sql | 28 + .../test_cumulative_metric__plan0.sql | 7 + ...cumulative_metric_grain_to_date__plan0.sql | 7 + .../test_cumulative_metric_no_ds__plan0.sql | 7 + ...est_cumulative_metric_no_window__plan0.sql | 7 + ..._no_window_with_time_constraint__plan0.sql | 14 + ...ive_metric_with_time_constraint__plan0.sql | 14 + .../Redshift/test_derived_metric__plan0.sql | 14 + ...ved_metric_with_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...rived_metric_with_offset_window__plan0.sql | 14 + ...h_offset_window_and_granularity__plan0.sql | 14 + ...fset_window_and_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...erived_offset_cumulative_metric__plan0.sql | 14 + ...et_metric_with_one_input_metric__plan0.sql | 7 + .../Redshift/test_distinct_values__plan0.sql | 14 + ...th_where_constraint_on_join_dim__plan0.sql | 14 + .../test_join_to_scd_dimension__plan0.sql | 21 +- ...join_to_scd_dimension__plan0_optimized.sql | 6 +- ...spine_node_with_offset_to_grain__plan0.sql | 7 + ...e_spine_node_with_offset_window__plan0.sql | 7 + ..._time_spine_node_without_offset__plan0.sql | 7 + .../Redshift/test_limit_rows__plan0.sql | 7 + ...al_dimension_using_local_entity__plan0.sql | 7 + .../test_measure_constraint__plan0.sql | 35 + ..._constraint_with_reused_measure__plan0.sql | 14 + ...aint_with_single_expr_and_alias__plan0.sql | 7 + ..._multiple_sources_no_dimensions__plan0.sql | 14 + ...multi_hop_through_scd_dimension__plan0.sql | 21 +- ...through_scd_dimension__plan0_optimized.sql | 10 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 21 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 10 +- .../Redshift/test_multihop_node__plan0.sql | 7 + ..._multiple_metrics_no_dimensions__plan0.sql | 28 + .../test_nested_derived_metric__plan0.sql | 28 + .../Redshift/test_partitioned_join__plan0.sql | 7 + .../test_common_semantic_model__plan0.sql | 14 + ...o_from_multiple_semantic_models__plan0.sql | 28 + .../test_cumulative_metric__plan0.sql | 7 + ...cumulative_metric_grain_to_date__plan0.sql | 7 + .../test_cumulative_metric_no_ds__plan0.sql | 7 + ...est_cumulative_metric_no_window__plan0.sql | 7 + ..._no_window_with_time_constraint__plan0.sql | 14 + ...ive_metric_with_time_constraint__plan0.sql | 14 + .../Snowflake/test_derived_metric__plan0.sql | 14 + ...ved_metric_with_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...rived_metric_with_offset_window__plan0.sql | 14 + ...h_offset_window_and_granularity__plan0.sql | 14 + ...fset_window_and_offset_to_grain__plan0.sql | 14 + ...offset_to_grain_and_granularity__plan0.sql | 14 + ...erived_offset_cumulative_metric__plan0.sql | 14 + ...et_metric_with_one_input_metric__plan0.sql | 7 + .../Snowflake/test_distinct_values__plan0.sql | 14 + ...th_where_constraint_on_join_dim__plan0.sql | 14 + .../test_join_to_scd_dimension__plan0.sql | 15 +- ...join_to_scd_dimension__plan0_optimized.sql | 4 +- ...spine_node_with_offset_to_grain__plan0.sql | 7 + ...e_spine_node_with_offset_window__plan0.sql | 7 + ..._time_spine_node_without_offset__plan0.sql | 7 + .../Snowflake/test_limit_rows__plan0.sql | 7 + ...al_dimension_using_local_entity__plan0.sql | 7 + .../test_measure_constraint__plan0.sql | 35 + ..._constraint_with_reused_measure__plan0.sql | 14 + ...aint_with_single_expr_and_alias__plan0.sql | 7 + ..._multiple_sources_no_dimensions__plan0.sql | 14 + ...multi_hop_through_scd_dimension__plan0.sql | 15 +- ...through_scd_dimension__plan0_optimized.sql | 6 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 21 +- ..._hop_to_scd_dimension__plan0_optimized.sql | 10 +- .../Snowflake/test_multihop_node__plan0.sql | 7 + ..._multiple_metrics_no_dimensions__plan0.sql | 28 + .../test_nested_derived_metric__plan0.sql | 28 + .../test_partitioned_join__plan0.sql | 7 + .../test_common_semantic_model__plan0.xml | 552 +++---- ...o_from_multiple_semantic_models__plan0.xml | 860 ++++++----- .../test_cumulative_metric__plan0.xml | 108 +- ...cumulative_metric_grain_to_date__plan0.xml | 108 +- .../test_cumulative_metric_no_ds__plan0.xml | 100 +- ...est_cumulative_metric_no_window__plan0.xml | 108 +- ..._no_window_with_time_constraint__plan0.xml | 204 ++- ...ive_metric_with_time_constraint__plan0.xml | 204 ++- .../test_derived_metric__plan0.xml | 558 +++---- ...ved_metric_with_offset_to_grain__plan0.xml | 748 +++++----- ...offset_to_grain_and_granularity__plan0.xml | 746 +++++----- ...rived_metric_with_offset_window__plan0.xml | 748 +++++----- ...h_offset_window_and_granularity__plan0.xml | 746 +++++----- ...fset_window_and_offset_to_grain__plan0.xml | 938 ++++++------ ...offset_to_grain_and_granularity__plan0.xml | 934 ++++++------ ...erived_offset_cumulative_metric__plan0.xml | 734 ++++----- ...et_metric_with_one_input_metric__plan0.xml | 468 +++--- .../test_distinct_values__plan0.xml | 476 +++--- ...th_where_constraint_on_join_dim__plan0.xml | 486 +++--- .../test_join_to_scd_dimension__plan0.xml | 298 ++-- ...spine_node_with_offset_to_grain__plan0.xml | 106 +- ...e_spine_node_with_offset_window__plan0.xml | 106 +- ..._time_spine_node_without_offset__plan0.xml | 106 +- .../SqlQueryPlan/test_limit_rows__plan0.xml | 280 ++-- ...al_dimension_using_local_entity__plan0.xml | 192 +-- .../test_measure_constraint__plan0.xml | 1268 +++++++++------- ..._constraint_with_reused_measure__plan0.xml | 570 +++---- ...aint_with_single_expr_and_alias__plan0.xml | 290 ++-- ..._multiple_sources_no_dimensions__plan0.xml | 456 +++--- ...multi_hop_through_scd_dimension__plan0.xml | 488 +++--- ...test_multi_hop_to_scd_dimension__plan0.xml | 468 +++--- .../test_multihop_node__plan0.xml | 326 ++-- ..._multiple_metrics_no_dimensions__plan0.xml | 1310 +++++++++-------- .../test_nested_derived_metric__plan0.xml | 1118 +++++++------- .../test_partitioned_join__plan0.xml | 190 ++- ...orm_node_using_non_primary_time__plan0.sql | 7 + ...sing_non_primary_time__plan0_optimized.sql | 7 + ...ansform_node_using_primary_time__plan0.sql | 7 + ...de_using_primary_time__plan0_optimized.sql | 7 + ...uery_with_metric_time_dimension__plan0.sql | 14 + ...orm_node_using_non_primary_time__plan0.sql | 7 + ...sing_non_primary_time__plan0_optimized.sql | 7 + ...ansform_node_using_primary_time__plan0.sql | 7 + ...de_using_primary_time__plan0_optimized.sql | 7 + ...uery_with_metric_time_dimension__plan0.sql | 14 + ...orm_node_using_non_primary_time__plan0.sql | 7 + ...sing_non_primary_time__plan0_optimized.sql | 7 + ...ansform_node_using_primary_time__plan0.sql | 7 + ...de_using_primary_time__plan0_optimized.sql | 7 + ...uery_with_metric_time_dimension__plan0.sql | 14 + ...orm_node_using_non_primary_time__plan0.sql | 7 + ...sing_non_primary_time__plan0_optimized.sql | 7 + ...ansform_node_using_primary_time__plan0.sql | 7 + ...de_using_primary_time__plan0_optimized.sql | 7 + ...uery_with_metric_time_dimension__plan0.sql | 14 + ...orm_node_using_non_primary_time__plan0.sql | 7 + ...sing_non_primary_time__plan0_optimized.sql | 7 + ...ansform_node_using_primary_time__plan0.sql | 7 + ...de_using_primary_time__plan0_optimized.sql | 7 + ...uery_with_metric_time_dimension__plan0.sql | 14 + ...orm_node_using_non_primary_time__plan0.sql | 7 + ...sing_non_primary_time__plan0_optimized.sql | 7 + ...ansform_node_using_primary_time__plan0.sql | 7 + ...de_using_primary_time__plan0_optimized.sql | 7 + ...uery_with_metric_time_dimension__plan0.sql | 14 + ...orm_node_using_non_primary_time__plan0.xml | 44 +- ...ansform_node_using_primary_time__plan0.xml | 68 +- ...uery_with_metric_time_dimension__plan0.xml | 504 ++++--- .../test_joined_node_data_set__result0.txt | 21 + metricflow/time/time_granularity.py | 22 +- 308 files changed, 13101 insertions(+), 8250 deletions(-) diff --git a/metricflow/dataset/dataset.py b/metricflow/dataset/dataset.py index 38e25616a5..ea88d69b72 100644 --- a/metricflow/dataset/dataset.py +++ b/metricflow/dataset/dataset.py @@ -1,7 +1,7 @@ from __future__ import annotations import logging -from typing import Sequence +from typing import Optional, Sequence from dbt_semantic_interfaces.references import TimeDimensionReference from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity @@ -9,6 +9,7 @@ from metricflow.instances import InstanceSet, TimeDimensionInstance from metricflow.specs.specs import TimeDimensionSpec +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -48,12 +49,15 @@ def metric_time_dimension_name() -> str: return DataSet.metric_time_dimension_reference().element_name @staticmethod - def metric_time_dimension_spec(time_granularity: TimeGranularity) -> TimeDimensionSpec: + def metric_time_dimension_spec( + time_granularity: TimeGranularity, date_part: Optional[DatePart] = None + ) -> TimeDimensionSpec: """Spec that corresponds to DataSet.metric_time_dimension_reference.""" return TimeDimensionSpec( element_name=DataSet.metric_time_dimension_reference().element_name, entity_links=(), time_granularity=time_granularity, + date_part=date_part, ) def __repr__(self) -> str: # noqa: D diff --git a/metricflow/naming/linkable_spec_name.py b/metricflow/naming/linkable_spec_name.py index 1cfe2b9804..01c3863ad0 100644 --- a/metricflow/naming/linkable_spec_name.py +++ b/metricflow/naming/linkable_spec_name.py @@ -46,8 +46,14 @@ def from_name(qualified_name: str) -> StructuredLinkableSpecName: if associated_date_part: # e.g. "ds__extract_month" if len(name_parts) == 2: + # Since DAY works with all currently supported DateParts & changing the granularity will not change the + # extracted date part, assume day granularity here. + time_granularity = TimeGranularity.DAY return StructuredLinkableSpecName( - entity_link_names=(), element_name=name_parts[0], date_part=associated_date_part + entity_link_names=(), + element_name=name_parts[0], + time_granularity=time_granularity, + date_part=associated_date_part, ) # e.g. "messages__ds__extract_month" return StructuredLinkableSpecName( diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 8f80437a08..6dc0db4c23 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -1116,7 +1116,6 @@ def visit_metric_time_dimension_transform_node( if ( len(time_dimension_instance.spec.entity_links) == 0 and time_dimension_instance.spec.reference == node.aggregation_time_dimension_reference - and time_dimension_instance.spec.date_part is None ): matching_time_dimension_instances.append(time_dimension_instance) @@ -1127,7 +1126,8 @@ def visit_metric_time_dimension_transform_node( # For those matching time dimension instances, create the analog metric time dimension instances for the output. for matching_time_dimension_instance in matching_time_dimension_instances: metric_time_dimension_spec = DataSet.metric_time_dimension_spec( - matching_time_dimension_instance.spec.time_granularity + time_granularity=matching_time_dimension_instance.spec.time_granularity, + date_part=matching_time_dimension_instance.spec.date_part, ) metric_time_dimension_column_association = self._column_association_resolver.resolve_spec( metric_time_dimension_spec diff --git a/metricflow/plan_conversion/instance_converters.py b/metricflow/plan_conversion/instance_converters.py index d741d8f711..07bf4922f1 100644 --- a/metricflow/plan_conversion/instance_converters.py +++ b/metricflow/plan_conversion/instance_converters.py @@ -47,6 +47,7 @@ SqlFunctionExpression, ) from metricflow.sql.sql_plan import SqlSelectColumn +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -262,6 +263,7 @@ class _DimensionValidityParams: dimension_name: str time_granularity: TimeGranularity + date_part: Optional[DatePart] = None class CreateValidityWindowJoinDescription(InstanceSetTransform[Optional[ValidityWindowJoinDescription]]): @@ -324,12 +326,16 @@ def transform(self, instance_set: InstanceSet) -> Optional[ValidityWindowJoinDes start_specs = [ spec for spec in specs - if spec.element_name == start_dim.dimension_name and spec.time_granularity == start_dim.time_granularity + if spec.element_name == start_dim.dimension_name + and spec.time_granularity == start_dim.time_granularity + and spec.date_part == start_dim.date_part ] end_specs = [ spec for spec in specs - if spec.element_name == end_dim.dimension_name and spec.time_granularity == end_dim.time_granularity + if spec.element_name == end_dim.dimension_name + and spec.time_granularity == end_dim.time_granularity + and spec.date_part == end_dim.date_part ] linkless_start_specs = {spec.without_entity_links for spec in start_specs} linkless_end_specs = {spec.without_entity_links for spec in end_specs} diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index b3e79b4e45..6f437117ac 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -299,7 +299,7 @@ def _get_group_by_names( return ( group_by_names if group_by_names - else [f"{g.name}__{g.grain}" if g.grain else g.name for g in group_by] + else [f"{g.name}__{g.date_part or g.grain}" if (g.date_part or g.grain) else g.name for g in group_by] if group_by else [] ) @@ -669,6 +669,7 @@ def _parse_linkable_element_names( element_name=element_name, entity_links=entity_links, time_granularity=structured_name.time_granularity, + date_part=structured_name.date_part, ) ) else: diff --git a/metricflow/specs/query_interface.py b/metricflow/specs/query_interface.py index ee55a52086..1939c7dbe2 100644 --- a/metricflow/specs/query_interface.py +++ b/metricflow/specs/query_interface.py @@ -4,6 +4,8 @@ from dbt_semantic_interfaces.type_enums import TimeGranularity +from metricflow.time.date_part import DatePart + class QueryInterfaceMetric(Protocol): """Metric in the query interface.""" @@ -27,6 +29,11 @@ def grain(self) -> Optional[TimeGranularity]: """The time granularity.""" raise NotImplementedError + @property + def date_part(self) -> Optional[DatePart]: + """Date part to extract from the dimension.""" + raise NotImplementedError + class QueryInterfaceDimension(Protocol): """Represents the interface for Dimension in the query interface.""" @@ -39,6 +46,10 @@ def alias(self, _alias: str) -> QueryInterfaceDimension: """Renaming the column.""" raise NotImplementedError + def date_part(self, _date_part: str) -> QueryInterfaceDimension: + """Date part to extract from the dimension.""" + raise NotImplementedError + class QueryInterfaceDimensionFactory(Protocol): """Creates a Dimension for the query interface. @@ -67,6 +78,7 @@ def create( self, time_dimension_name: str, time_granularity_name: str, + date_part_name: Optional[str] = None, entity_path: Sequence[str] = (), ) -> QueryInterfaceTimeDimension: """Create a TimeDimension.""" diff --git a/metricflow/specs/where_filter_dimension.py b/metricflow/specs/where_filter_dimension.py index 3f33f87d96..d37fec3f8b 100644 --- a/metricflow/specs/where_filter_dimension.py +++ b/metricflow/specs/where_filter_dimension.py @@ -36,6 +36,10 @@ def grain(self, _grain: str) -> QueryInterfaceDimension: """The time granularity.""" raise NotImplementedError + def date_part(self, _date_part: str) -> QueryInterfaceDimension: + """The date_part requested to extract.""" + raise NotImplementedError + def alias(self, _alias: str) -> QueryInterfaceDimension: """Renaming the column.""" raise NotImplementedError diff --git a/metricflow/specs/where_filter_entity.py b/metricflow/specs/where_filter_entity.py index 5631fb669e..8b30ef14d5 100644 --- a/metricflow/specs/where_filter_entity.py +++ b/metricflow/specs/where_filter_entity.py @@ -12,15 +12,15 @@ from typing_extensions import override from metricflow.specs.column_assoc import ColumnAssociationResolver -from metricflow.specs.query_interface import QueryInterfaceDimension, QueryInterfaceEntityFactory +from metricflow.specs.query_interface import QueryInterfaceEntity, QueryInterfaceEntityFactory from metricflow.specs.specs import EntitySpec -class WhereFilterEntity(ProtocolHint[QueryInterfaceDimension]): +class WhereFilterEntity(ProtocolHint[QueryInterfaceEntity]): """An entity that is passed in through the where filter parameter.""" @override - def _implements_protocol(self) -> QueryInterfaceDimension: + def _implements_protocol(self) -> QueryInterfaceEntity: return self def __init__(self, column_name: str): # noqa diff --git a/metricflow/specs/where_filter_time_dimension.py b/metricflow/specs/where_filter_time_dimension.py index 0dd23ad0d4..34901ca269 100644 --- a/metricflow/specs/where_filter_time_dimension.py +++ b/metricflow/specs/where_filter_time_dimension.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import List, Sequence +from typing import List, Optional, Sequence from dbt_semantic_interfaces.call_parameter_sets import FilterCallParameterSets, TimeDimensionCallParameterSet from dbt_semantic_interfaces.naming.dundered import DunderedNameFormatter @@ -28,6 +28,10 @@ def grain(self, _grain: str) -> WhereFilterTimeDimension: """The time granularity.""" raise NotImplementedError + def date_part(self, _date_part: str) -> WhereFilterTimeDimension: + """Requested date_part to extract.""" + raise NotImplementedError + def alias(self, _alias: str) -> WhereFilterTimeDimension: """Renaming the column.""" raise NotImplementedError @@ -60,7 +64,11 @@ def __init__( # noqa self.time_dimension_specs: List[TimeDimensionSpec] = [] def create( - self, time_dimension_name: str, time_granularity_name: str, entity_path: Sequence[str] = () + self, + time_dimension_name: str, + time_granularity_name: str, + date_part_name: Optional[str] = None, + entity_path: Sequence[str] = (), ) -> WhereFilterTimeDimension: """Create a WhereFilterTimeDimension.""" structured_name = DunderedNameFormatter.parse_name(time_dimension_name) diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index 856b591781..ced9b011a1 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1043,3 +1043,17 @@ integration_test: ) b ON a.metric_time__week = b.metric_time__week AND a.metric_time__month = b.metric_time__month +--- +integration_test: + name: simple_query_with_date_part + description: Test query using date_part + model: SIMPLE_MODEL + metrics: ["bookings"] + group_bys: ["metric_time__extract_dayofweek"] + check_query: | + SELECT + SUM(1) AS bookings + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + FROM {{ source_schema }}.fct_bookings + GROUP BY EXTRACT(DAYOFWEEK FROM ds); +# TODO: test with cumulative metric, offset metric, others? diff --git a/metricflow/test/query/test_query_parser.py b/metricflow/test/query/test_query_parser.py index d585ab4465..b4962b4bee 100644 --- a/metricflow/test/query/test_query_parser.py +++ b/metricflow/test/query/test_query_parser.py @@ -175,6 +175,7 @@ class MockQueryParameter: """This is a mock that is just used to test the query parser.""" grain = None + date_part = None def __init__(self, name: str): # noqa: D self.name = name diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql index b320e6bd7b..98ccda3807 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 0715f5e0da..561210bfe0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -123,6 +123,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -307,6 +314,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -484,6 +498,13 @@ FROM ( , subq_10.ds__month AS metric_time__month , subq_10.ds__quarter AS metric_time__quarter , subq_10.ds__year AS metric_time__year + , subq_10.ds__extract_year AS metric_time__extract_year + , subq_10.ds__extract_quarter AS metric_time__extract_quarter + , subq_10.ds__extract_month AS metric_time__extract_month + , subq_10.ds__extract_week AS metric_time__extract_week + , subq_10.ds__extract_day AS metric_time__extract_day + , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_10.listing , subq_10.user , subq_10.view__listing @@ -611,6 +632,13 @@ FROM ( , subq_13.ds__month AS metric_time__month , subq_13.ds__quarter AS metric_time__quarter , subq_13.ds__year AS metric_time__year + , subq_13.ds__extract_year AS metric_time__extract_year + , subq_13.ds__extract_quarter AS metric_time__extract_quarter + , subq_13.ds__extract_month AS metric_time__extract_month + , subq_13.ds__extract_week AS metric_time__extract_week + , subq_13.ds__extract_day AS metric_time__extract_day + , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_13.listing , subq_13.user , subq_13.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql index 932baf10dc..cc45bf1891 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql index 3ed483e9d4..d4dd5b361d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql index 0f802052ea..0f93debdc2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql @@ -42,6 +42,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql index 1f5785cdff..06c8ba798c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 6f77ab2cfe..b7e9032ac9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql index b53f5ed26c..9e6b7ea463 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql index 6c4ce49599..bfe2d094f8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -326,6 +333,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql index 56f97cc21c..9ca086a919 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index a501f2c21b..52d9d94da7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql index 64b240f7de..1b1449615b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 706834fa9c..475e77c5dc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 65759f67e7..f2aa5d7c8c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -535,6 +542,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 12e3863ba1..e057de623f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -536,6 +543,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql index 77bb8bd9ad..7a120c1236 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_week AS metric_time__extract_week + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -308,6 +315,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql index 7636cc1e70..19b237f759 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql index 58dc1a7753..95a9c68e3f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql @@ -114,6 +114,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -298,6 +305,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql index eac727a04f..298d60b12f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -120,6 +120,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -304,6 +311,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql index d35cde616a..bc49c849ed 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__extract_week AS listing__window_end__extract_week + , subq_4.window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -122,6 +122,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -236,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__day - , subq_3.window_end__extract_week + subq_3.window_start__extract_dayofyear + , subq_3.window_end__day , subq_3.listing , subq_3.capacity FROM ( @@ -308,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__day + subq_2.metric_time__day >= subq_4.window_start__extract_dayofyear ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_week + subq_2.metric_time__day < subq_4.window_end__day ) OR ( - subq_4.window_end__extract_week IS NULL + subq_4.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql index f0af95c23f..d9f3cf01a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= listings_src_10017.active_from + subq_12.metric_time__day >= EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < EXTRACT(WEEK FROM listings_src_10017.active_to) + subq_12.metric_time__day < listings_src_10017.active_to ) OR ( - EXTRACT(WEEK FROM listings_src_10017.active_to) IS NULL + listings_src_10017.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index c5d9e328b3..16eb99e413 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql index 31b984a461..fbeb26604f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql index e346d4997e..2162a5c2ad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql index e02fa3f09c..aa307ac3ae 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql @@ -98,6 +98,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql index ee95464b60..c02240d603 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql @@ -69,6 +69,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.user , subq_0.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql index 6385db4297..f83d1e53c7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql @@ -132,6 +132,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -316,6 +323,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -529,6 +543,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -713,6 +734,13 @@ FROM ( , subq_15.ds__month AS metric_time__month , subq_15.ds__quarter AS metric_time__quarter , subq_15.ds__year AS metric_time__year + , subq_15.ds__extract_year AS metric_time__extract_year + , subq_15.ds__extract_quarter AS metric_time__extract_quarter + , subq_15.ds__extract_month AS metric_time__extract_month + , subq_15.ds__extract_week AS metric_time__extract_week + , subq_15.ds__extract_day AS metric_time__extract_day + , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_15.listing , subq_15.user , subq_15.listing__user @@ -909,6 +937,13 @@ FROM ( , subq_24.ds__month AS metric_time__month , subq_24.ds__quarter AS metric_time__quarter , subq_24.ds__year AS metric_time__year + , subq_24.ds__extract_year AS metric_time__extract_year + , subq_24.ds__extract_quarter AS metric_time__extract_quarter + , subq_24.ds__extract_month AS metric_time__extract_month + , subq_24.ds__extract_week AS metric_time__extract_week + , subq_24.ds__extract_day AS metric_time__extract_day + , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_24.listing , subq_24.guest , subq_24.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql index 9352ceb3e2..28f70455e3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql @@ -117,6 +117,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -342,6 +349,13 @@ FROM ( , subq_7.ds__month AS metric_time__month , subq_7.ds__quarter AS metric_time__quarter , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_week AS metric_time__extract_week + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_7.listing , subq_7.guest , subq_7.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql index f40149ee65..933c4905c0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -111,6 +111,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 8c59fd497e..3c83f6b210 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -292,6 +299,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.user , subq_5.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql index 49ab8afb27..024c911d5b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__day AS listing__window_start__day - , subq_7.window_end__extract_week AS listing__window_end__extract_week + , subq_7.window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -226,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__day - , subq_6.window_end__extract_week + subq_6.window_start__extract_dayofyear + , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -464,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__day + subq_2.metric_time__day >= subq_7.window_start__extract_dayofyear ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_week + subq_2.metric_time__day < subq_7.window_end__day ) OR ( - subq_7.window_end__extract_week IS NULL + subq_7.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql index dfbf523e63..6fee75f492 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - listings_src_10017.active_from AS window_start__day - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week + EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__day + subq_13.metric_time__day >= subq_18.window_start__extract_dayofyear ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_week + subq_13.metric_time__day < subq_18.window_end__day ) OR ( - subq_18.window_end__extract_week IS NULL + subq_18.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql index 9114deef3f..2f8078af36 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day + , subq_7.lux_listing__window_start__extract_day AS listing__lux_listing__window_start__extract_day , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -229,7 +236,7 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__day + subq_6.lux_listing__window_start__extract_day , subq_6.lux_listing__window_end__extract_month , subq_6.listing , subq_6.lux_listing__is_confirmed_lux @@ -443,7 +450,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_day ) AND ( ( subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql index 33a9a609fa..2ab605916c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,7 +26,7 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - lux_listings_src_10019.valid_from AS lux_listing__window_start__day + EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux @@ -41,7 +41,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_day ) AND ( ( subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql index 28e5abd86f..b0ede76214 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql index 696514d415..7a1160e719 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql @@ -95,6 +95,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.listing , subq_1.guest , subq_1.host @@ -196,6 +203,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -391,6 +405,13 @@ CROSS JOIN ( , subq_7.metric_time__month , subq_7.metric_time__quarter , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_week + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dayofweek + , subq_7.metric_time__extract_dayofyear , subq_7.listing , subq_7.user , subq_7.listing__user @@ -459,6 +480,13 @@ CROSS JOIN ( , subq_6.ds__month AS metric_time__month , subq_6.ds__quarter AS metric_time__quarter , subq_6.ds__year AS metric_time__year + , subq_6.ds__extract_year AS metric_time__extract_year + , subq_6.ds__extract_quarter AS metric_time__extract_quarter + , subq_6.ds__extract_month AS metric_time__extract_month + , subq_6.ds__extract_week AS metric_time__extract_week + , subq_6.ds__extract_day AS metric_time__extract_day + , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_6.listing , subq_6.user , subq_6.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql index 79e108f49f..530e65ec20 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql @@ -116,6 +116,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -338,6 +345,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host @@ -572,6 +586,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -804,6 +825,13 @@ FROM ( , subq_17.ds__month AS metric_time__month , subq_17.ds__quarter AS metric_time__quarter , subq_17.ds__year AS metric_time__year + , subq_17.ds__extract_year AS metric_time__extract_year + , subq_17.ds__extract_quarter AS metric_time__extract_quarter + , subq_17.ds__extract_month AS metric_time__extract_month + , subq_17.ds__extract_week AS metric_time__extract_week + , subq_17.ds__extract_day AS metric_time__extract_day + , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_17.listing , subq_17.guest , subq_17.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql index e04b6506be..ce7f3ffa85 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.verification , subq_0.user , subq_0.verification__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql index 8209ee600a..e98764d3a8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index e556d194aa..83df46b3c4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -123,6 +123,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -307,6 +314,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -484,6 +498,13 @@ FROM ( , subq_10.ds__month AS metric_time__month , subq_10.ds__quarter AS metric_time__quarter , subq_10.ds__year AS metric_time__year + , subq_10.ds__extract_year AS metric_time__extract_year + , subq_10.ds__extract_quarter AS metric_time__extract_quarter + , subq_10.ds__extract_month AS metric_time__extract_month + , subq_10.ds__extract_week AS metric_time__extract_week + , subq_10.ds__extract_day AS metric_time__extract_day + , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_10.listing , subq_10.user , subq_10.view__listing @@ -611,6 +632,13 @@ FROM ( , subq_13.ds__month AS metric_time__month , subq_13.ds__quarter AS metric_time__quarter , subq_13.ds__year AS metric_time__year + , subq_13.ds__extract_year AS metric_time__extract_year + , subq_13.ds__extract_quarter AS metric_time__extract_quarter + , subq_13.ds__extract_month AS metric_time__extract_month + , subq_13.ds__extract_week AS metric_time__extract_week + , subq_13.ds__extract_day AS metric_time__extract_day + , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_13.listing , subq_13.user , subq_13.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql index 7a21860fcb..5dd2138c23 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql index 98ba846b40..33a5834e5f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql index 4695227af1..12219e1521 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql @@ -42,6 +42,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql index d7d79e0e55..bcac8fdcad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index ea1c3531d4..61a5f71588 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql index 553a0f19f7..7c4b4abfb3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql index 50f09e5c00..24eacc8f9e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -326,6 +333,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql index 82c9f10475..bf72a9c59a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 9fe9c136c1..cdf5e6646b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql index daa52ca41e..5c396371e8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql index aa0f8a119a..7b2c9a7661 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index ecc7b21c32..f635bf528d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -535,6 +542,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 9ab034b843..c61f320f56 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -536,6 +543,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql index a3509be579..35a55ef78b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_week AS metric_time__extract_week + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -308,6 +315,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql index 466af8e156..4546c94c68 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql index 049dfd23fb..d4f664fec9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql @@ -114,6 +114,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -298,6 +305,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql index 479ed8d1ef..8b1ab2a969 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -120,6 +120,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -304,6 +311,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql index 35fca69027..613d0fde8e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_month AS listing__window_start__extract_month - , subq_4.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_4.window_start__day AS listing__window_start__day + , subq_4.window_end__extract_week AS listing__window_end__extract_week , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -122,6 +122,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -236,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_month - , subq_3.window_end__extract_dayofweek + subq_3.window_start__day + , subq_3.window_end__extract_week , subq_3.listing , subq_3.capacity FROM ( @@ -308,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_month + subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_dayofweek + subq_2.metric_time__day < subq_4.window_end__extract_week ) OR ( - subq_4.window_end__extract_dayofweek IS NULL + subq_4.window_end__extract_week IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql index 710e67b149..f0af95c23f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) + subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) + subq_12.metric_time__day < EXTRACT(WEEK FROM listings_src_10017.active_to) ) OR ( - EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) IS NULL + EXTRACT(WEEK FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 70accec611..9f0330a8c4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql index a6aabb20c2..a66f5d9a1e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql index 80e8fdda4b..71b77eaf66 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql index 42f33bb96e..3ba23c2e5a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql @@ -98,6 +98,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql index 973abdbb6f..2635220d21 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql @@ -69,6 +69,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.user , subq_0.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql index c99d63cffa..a3dc672f7f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql @@ -132,6 +132,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -316,6 +323,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -529,6 +543,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -713,6 +734,13 @@ FROM ( , subq_15.ds__month AS metric_time__month , subq_15.ds__quarter AS metric_time__quarter , subq_15.ds__year AS metric_time__year + , subq_15.ds__extract_year AS metric_time__extract_year + , subq_15.ds__extract_quarter AS metric_time__extract_quarter + , subq_15.ds__extract_month AS metric_time__extract_month + , subq_15.ds__extract_week AS metric_time__extract_week + , subq_15.ds__extract_day AS metric_time__extract_day + , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_15.listing , subq_15.user , subq_15.listing__user @@ -909,6 +937,13 @@ FROM ( , subq_24.ds__month AS metric_time__month , subq_24.ds__quarter AS metric_time__quarter , subq_24.ds__year AS metric_time__year + , subq_24.ds__extract_year AS metric_time__extract_year + , subq_24.ds__extract_quarter AS metric_time__extract_quarter + , subq_24.ds__extract_month AS metric_time__extract_month + , subq_24.ds__extract_week AS metric_time__extract_week + , subq_24.ds__extract_day AS metric_time__extract_day + , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_24.listing , subq_24.guest , subq_24.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql index 1e3f035827..2de235aece 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql @@ -117,6 +117,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -342,6 +349,13 @@ FROM ( , subq_7.ds__month AS metric_time__month , subq_7.ds__quarter AS metric_time__quarter , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_week AS metric_time__extract_week + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_7.listing , subq_7.guest , subq_7.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 1286214deb..5c4bf2859d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -111,6 +111,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 0b3cc84657..b75797d1e3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -292,6 +299,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.user , subq_5.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql index e0644705db..ff186bc953 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_month AS listing__window_start__extract_month - , subq_7.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_7.window_start__extract_week AS listing__window_start__extract_week + , subq_7.window_end__extract_dayofyear AS listing__window_end__extract_dayofyear , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -226,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_month - , subq_6.window_end__extract_dayofweek + subq_6.window_start__extract_week + , subq_6.window_end__extract_dayofyear , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -464,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_month + subq_2.metric_time__day >= subq_7.window_start__extract_week ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_dayofweek + subq_2.metric_time__day < subq_7.window_end__extract_dayofyear ) OR ( - subq_7.window_end__extract_dayofweek IS NULL + subq_7.window_end__extract_dayofyear IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 425b62e62c..060e8301a1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(DOY FROM listings_src_10017.active_to) AS window_end__extract_dayofyear , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_month + subq_13.metric_time__day >= subq_18.window_start__extract_week ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_dayofweek + subq_13.metric_time__day < subq_18.window_end__extract_dayofyear ) OR ( - subq_18.window_end__extract_dayofweek IS NULL + subq_18.window_end__extract_dayofyear IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql index 20137a0df6..7d569f8111 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_day AS listing__lux_listing__window_start__extract_day + , subq_7.lux_listing__window_start__extract_dayofweek AS listing__lux_listing__window_start__extract_dayofweek , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -229,7 +236,7 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_day + subq_6.lux_listing__window_start__extract_dayofweek , subq_6.lux_listing__window_end__extract_month , subq_6.listing , subq_6.lux_listing__is_confirmed_lux @@ -443,7 +450,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofweek ) AND ( ( subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql index b495cc4b52..aca1260a66 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,7 +26,7 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux @@ -41,7 +41,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofweek ) AND ( ( subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql index 234bd823d2..5e08760139 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql index 1ee70afb0b..7eaea2b4de 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql @@ -95,6 +95,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.listing , subq_1.guest , subq_1.host @@ -196,6 +203,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -391,6 +405,13 @@ CROSS JOIN ( , subq_7.metric_time__month , subq_7.metric_time__quarter , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_week + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dayofweek + , subq_7.metric_time__extract_dayofyear , subq_7.listing , subq_7.user , subq_7.listing__user @@ -459,6 +480,13 @@ CROSS JOIN ( , subq_6.ds__month AS metric_time__month , subq_6.ds__quarter AS metric_time__quarter , subq_6.ds__year AS metric_time__year + , subq_6.ds__extract_year AS metric_time__extract_year + , subq_6.ds__extract_quarter AS metric_time__extract_quarter + , subq_6.ds__extract_month AS metric_time__extract_month + , subq_6.ds__extract_week AS metric_time__extract_week + , subq_6.ds__extract_day AS metric_time__extract_day + , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_6.listing , subq_6.user , subq_6.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql index 7cc6e2d906..fae92e63dc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql @@ -116,6 +116,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -338,6 +345,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host @@ -572,6 +586,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -804,6 +825,13 @@ FROM ( , subq_17.ds__month AS metric_time__month , subq_17.ds__quarter AS metric_time__quarter , subq_17.ds__year AS metric_time__year + , subq_17.ds__extract_year AS metric_time__extract_year + , subq_17.ds__extract_quarter AS metric_time__extract_quarter + , subq_17.ds__extract_month AS metric_time__extract_month + , subq_17.ds__extract_week AS metric_time__extract_week + , subq_17.ds__extract_day AS metric_time__extract_day + , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_17.listing , subq_17.guest , subq_17.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql index e7c3deecdb..6eeaaeaeef 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.verification , subq_0.user , subq_0.verification__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql index 073c7964da..d2a3c6afd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index d5d52443ea..c45302afaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -123,6 +123,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -307,6 +314,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -484,6 +498,13 @@ FROM ( , subq_10.ds__month AS metric_time__month , subq_10.ds__quarter AS metric_time__quarter , subq_10.ds__year AS metric_time__year + , subq_10.ds__extract_year AS metric_time__extract_year + , subq_10.ds__extract_quarter AS metric_time__extract_quarter + , subq_10.ds__extract_month AS metric_time__extract_month + , subq_10.ds__extract_week AS metric_time__extract_week + , subq_10.ds__extract_day AS metric_time__extract_day + , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_10.listing , subq_10.user , subq_10.view__listing @@ -611,6 +632,13 @@ FROM ( , subq_13.ds__month AS metric_time__month , subq_13.ds__quarter AS metric_time__quarter , subq_13.ds__year AS metric_time__year + , subq_13.ds__extract_year AS metric_time__extract_year + , subq_13.ds__extract_quarter AS metric_time__extract_quarter + , subq_13.ds__extract_month AS metric_time__extract_month + , subq_13.ds__extract_week AS metric_time__extract_week + , subq_13.ds__extract_day AS metric_time__extract_day + , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_13.listing , subq_13.user , subq_13.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql index f52c8d6acf..ad08f90e35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql index 4e79154b70..8c2ab1a915 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql index f44071348d..8d5b07c69a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql @@ -42,6 +42,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql index 4c321e73b0..d98f0f554a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 4821d797fe..26ab44afcc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql index 2a39c9282f..a670ac2189 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql index 82ded0a878..3d88c96009 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -326,6 +333,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql index f21c6e33a7..e2ff275b47 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 34b929887f..13d462ce84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql index de24654075..7763daf079 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 3da362bd96..8a1592b8e5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 001633ef6d..793e7f674c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -535,6 +542,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 0d2a73ccaa..fd2a08f4dc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -536,6 +543,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql index 11133f2d42..9ff5c7ed82 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_week AS metric_time__extract_week + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -308,6 +315,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql index 467707f734..781610f066 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql index 3adff18e62..693e200db3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql @@ -114,6 +114,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -298,6 +305,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql index eb70f04221..1a6844636c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -120,6 +120,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -304,6 +311,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql index a1b2d01a0f..5712e1d25c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_month AS listing__window_start__extract_month - , subq_4.window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_4.window_start__day AS listing__window_start__day + , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -122,6 +122,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -236,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_month - , subq_3.window_end__extract_quarter + subq_3.window_start__day + , subq_3.window_end__day , subq_3.listing , subq_3.capacity FROM ( @@ -308,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_month + subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_quarter + subq_2.metric_time__day < subq_4.window_end__day ) OR ( - subq_4.window_end__extract_quarter IS NULL + subq_4.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql index 28a4fe2ec0..86a2010b35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) + subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < EXTRACT(QUARTER FROM listings_src_10017.active_to) + subq_12.metric_time__day < listings_src_10017.active_to ) OR ( - EXTRACT(QUARTER FROM listings_src_10017.active_to) IS NULL + listings_src_10017.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ef8853985..141c4fba09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql index 18e509dd5c..093b149ba2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql index 16e8afe8d0..7c85ab1cdb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql index b00d690648..e89a957806 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql @@ -98,6 +98,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql index 583b4a4bf0..436f0e7545 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql @@ -69,6 +69,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.user , subq_0.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql index 437dc887b4..9223eebd6e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql @@ -132,6 +132,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -316,6 +323,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -529,6 +543,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -713,6 +734,13 @@ FROM ( , subq_15.ds__month AS metric_time__month , subq_15.ds__quarter AS metric_time__quarter , subq_15.ds__year AS metric_time__year + , subq_15.ds__extract_year AS metric_time__extract_year + , subq_15.ds__extract_quarter AS metric_time__extract_quarter + , subq_15.ds__extract_month AS metric_time__extract_month + , subq_15.ds__extract_week AS metric_time__extract_week + , subq_15.ds__extract_day AS metric_time__extract_day + , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_15.listing , subq_15.user , subq_15.listing__user @@ -909,6 +937,13 @@ FROM ( , subq_24.ds__month AS metric_time__month , subq_24.ds__quarter AS metric_time__quarter , subq_24.ds__year AS metric_time__year + , subq_24.ds__extract_year AS metric_time__extract_year + , subq_24.ds__extract_quarter AS metric_time__extract_quarter + , subq_24.ds__extract_month AS metric_time__extract_month + , subq_24.ds__extract_week AS metric_time__extract_week + , subq_24.ds__extract_day AS metric_time__extract_day + , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_24.listing , subq_24.guest , subq_24.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql index 37ad3a608e..1f9e7a4524 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql @@ -117,6 +117,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -342,6 +349,13 @@ FROM ( , subq_7.ds__month AS metric_time__month , subq_7.ds__quarter AS metric_time__quarter , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_week AS metric_time__extract_week + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_7.listing , subq_7.guest , subq_7.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql index a495423238..2d8a10e755 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -111,6 +111,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 0e4cdb1a6a..4ef0714be2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -292,6 +299,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.user , subq_5.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql index c65a26cd35..db50a9f2c8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_month AS listing__window_start__extract_month - , subq_7.window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_7.window_start__day AS listing__window_start__day + , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -226,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_month - , subq_6.window_end__extract_quarter + subq_6.window_start__day + , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -464,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_month + subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_quarter + subq_2.metric_time__day < subq_7.window_end__day ) OR ( - subq_7.window_end__extract_quarter IS NULL + subq_7.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 7633c731a1..feb5ed0fdc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter + listings_src_10017.active_from AS window_start__day + , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_month + subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_quarter + subq_13.metric_time__day < subq_18.window_end__day ) OR ( - subq_18.window_end__extract_quarter IS NULL + subq_18.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql index a451f1ac42..adaf16cf58 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql @@ -21,7 +21,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day - , subq_7.lux_listing__window_end__extract_day AS listing__lux_listing__window_end__extract_day + , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -230,7 +237,7 @@ FROM ( -- 'listing'] SELECT subq_6.lux_listing__window_start__day - , subq_6.lux_listing__window_end__extract_day + , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -446,9 +453,9 @@ FROM ( subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_day + subq_2.metric_time__day < subq_7.lux_listing__window_end__day ) OR ( - subq_7.lux_listing__window_end__extract_day IS NULL + subq_7.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql index ff50adbf8b..f1b419a284 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -27,7 +27,7 @@ LEFT OUTER JOIN ( -- 'listing'] SELECT lux_listings_src_10019.valid_from AS lux_listing__window_start__day - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -44,9 +44,9 @@ ON subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_day + subq_13.metric_time__day < subq_18.lux_listing__window_end__day ) OR ( - subq_18.lux_listing__window_end__extract_day IS NULL + subq_18.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql index fbddd59f54..7638105966 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql index eb31a4fb3a..3d8fba9b22 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql @@ -95,6 +95,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.listing , subq_1.guest , subq_1.host @@ -196,6 +203,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -391,6 +405,13 @@ CROSS JOIN ( , subq_7.metric_time__month , subq_7.metric_time__quarter , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_week + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dayofweek + , subq_7.metric_time__extract_dayofyear , subq_7.listing , subq_7.user , subq_7.listing__user @@ -459,6 +480,13 @@ CROSS JOIN ( , subq_6.ds__month AS metric_time__month , subq_6.ds__quarter AS metric_time__quarter , subq_6.ds__year AS metric_time__year + , subq_6.ds__extract_year AS metric_time__extract_year + , subq_6.ds__extract_quarter AS metric_time__extract_quarter + , subq_6.ds__extract_month AS metric_time__extract_month + , subq_6.ds__extract_week AS metric_time__extract_week + , subq_6.ds__extract_day AS metric_time__extract_day + , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_6.listing , subq_6.user , subq_6.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql index dc0afd0f09..138d3b47ca 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql @@ -116,6 +116,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -338,6 +345,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host @@ -572,6 +586,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -804,6 +825,13 @@ FROM ( , subq_17.ds__month AS metric_time__month , subq_17.ds__quarter AS metric_time__quarter , subq_17.ds__year AS metric_time__year + , subq_17.ds__extract_year AS metric_time__extract_year + , subq_17.ds__extract_quarter AS metric_time__extract_quarter + , subq_17.ds__extract_month AS metric_time__extract_month + , subq_17.ds__extract_week AS metric_time__extract_week + , subq_17.ds__extract_day AS metric_time__extract_day + , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_17.listing , subq_17.guest , subq_17.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql index a53f3a075b..e43e265eff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.verification , subq_0.user , subq_0.verification__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql index 073c7964da..d2a3c6afd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 5f9a321abd..2426067bd3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -123,6 +123,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -307,6 +314,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -484,6 +498,13 @@ FROM ( , subq_10.ds__month AS metric_time__month , subq_10.ds__quarter AS metric_time__quarter , subq_10.ds__year AS metric_time__year + , subq_10.ds__extract_year AS metric_time__extract_year + , subq_10.ds__extract_quarter AS metric_time__extract_quarter + , subq_10.ds__extract_month AS metric_time__extract_month + , subq_10.ds__extract_week AS metric_time__extract_week + , subq_10.ds__extract_day AS metric_time__extract_day + , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_10.listing , subq_10.user , subq_10.view__listing @@ -611,6 +632,13 @@ FROM ( , subq_13.ds__month AS metric_time__month , subq_13.ds__quarter AS metric_time__quarter , subq_13.ds__year AS metric_time__year + , subq_13.ds__extract_year AS metric_time__extract_year + , subq_13.ds__extract_quarter AS metric_time__extract_quarter + , subq_13.ds__extract_month AS metric_time__extract_month + , subq_13.ds__extract_week AS metric_time__extract_week + , subq_13.ds__extract_day AS metric_time__extract_day + , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_13.listing , subq_13.user , subq_13.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql index f52c8d6acf..ad08f90e35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql index 4e79154b70..8c2ab1a915 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql index f44071348d..8d5b07c69a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql @@ -42,6 +42,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql index 4c321e73b0..d98f0f554a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 4821d797fe..26ab44afcc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql index 2a39c9282f..a670ac2189 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql index 82ded0a878..3d88c96009 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -326,6 +333,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql index f21c6e33a7..e2ff275b47 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 34b929887f..13d462ce84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql index dc71eeec86..d22bf333b1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql index de37ca714a..7255f068da 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index eb915512e3..aa40a31b84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -535,6 +542,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index bd5554a5b6..e829053048 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -536,6 +543,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql index 209f65b14c..106574c4c7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_week AS metric_time__extract_week + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -308,6 +315,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql index 6b3ac53490..16a95d6b9f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql index 3adff18e62..693e200db3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql @@ -114,6 +114,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -298,6 +305,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql index eb70f04221..1a6844636c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -120,6 +120,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -304,6 +311,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql index fa5e69d429..08dd31437a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_week AS listing__window_start__extract_week - , subq_4.window_end__day AS listing__window_end__day + , subq_4.window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_4.window_end__extract_quarter AS listing__window_end__extract_quarter , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -122,6 +122,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -236,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_week - , subq_3.window_end__day + subq_3.window_start__extract_dayofyear + , subq_3.window_end__extract_quarter , subq_3.listing , subq_3.capacity FROM ( @@ -308,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_week + subq_2.metric_time__day >= subq_4.window_start__extract_dayofyear ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__day + subq_2.metric_time__day < subq_4.window_end__extract_quarter ) OR ( - subq_4.window_end__day IS NULL + subq_4.window_end__extract_quarter IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql index fcdd8a3083..297e00735f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(WEEK FROM listings_src_10017.active_from) + subq_12.metric_time__day >= EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < listings_src_10017.active_to + subq_12.metric_time__day < EXTRACT(QUARTER FROM listings_src_10017.active_to) ) OR ( - listings_src_10017.active_to IS NULL + EXTRACT(QUARTER FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ef8853985..141c4fba09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql index 8e64ced98e..abf246ee40 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql index 16e8afe8d0..7c85ab1cdb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql index b00d690648..e89a957806 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql @@ -98,6 +98,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql index 583b4a4bf0..436f0e7545 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql @@ -69,6 +69,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.user , subq_0.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql index 437dc887b4..9223eebd6e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql @@ -132,6 +132,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -316,6 +323,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -529,6 +543,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -713,6 +734,13 @@ FROM ( , subq_15.ds__month AS metric_time__month , subq_15.ds__quarter AS metric_time__quarter , subq_15.ds__year AS metric_time__year + , subq_15.ds__extract_year AS metric_time__extract_year + , subq_15.ds__extract_quarter AS metric_time__extract_quarter + , subq_15.ds__extract_month AS metric_time__extract_month + , subq_15.ds__extract_week AS metric_time__extract_week + , subq_15.ds__extract_day AS metric_time__extract_day + , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_15.listing , subq_15.user , subq_15.listing__user @@ -909,6 +937,13 @@ FROM ( , subq_24.ds__month AS metric_time__month , subq_24.ds__quarter AS metric_time__quarter , subq_24.ds__year AS metric_time__year + , subq_24.ds__extract_year AS metric_time__extract_year + , subq_24.ds__extract_quarter AS metric_time__extract_quarter + , subq_24.ds__extract_month AS metric_time__extract_month + , subq_24.ds__extract_week AS metric_time__extract_week + , subq_24.ds__extract_day AS metric_time__extract_day + , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_24.listing , subq_24.guest , subq_24.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql index 9626242169..0512790e47 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql @@ -117,6 +117,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -342,6 +349,13 @@ FROM ( , subq_7.ds__month AS metric_time__month , subq_7.ds__quarter AS metric_time__quarter , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_week AS metric_time__extract_week + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_7.listing , subq_7.guest , subq_7.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql index a495423238..2d8a10e755 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -111,6 +111,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index c868e3cfd9..f000943d3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -292,6 +299,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.user , subq_5.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql index 760a9d333e..0bcca6489b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_week AS listing__window_start__extract_week + , subq_7.window_start__extract_day AS listing__window_start__extract_day , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -226,7 +233,7 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_week + subq_6.window_start__extract_day , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest @@ -464,7 +471,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_week + subq_2.metric_time__day >= subq_7.window_start__extract_day ) AND ( ( subq_2.metric_time__day < subq_7.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 579c5ff3a6..fdc48352dd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,7 +23,7 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week + EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest @@ -38,7 +38,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_week + subq_13.metric_time__day >= subq_18.window_start__extract_day ) AND ( ( subq_13.metric_time__day < subq_18.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql index 138a7d9525..bc41ed72fa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql index fbddd59f54..7638105966 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql index eb31a4fb3a..3d8fba9b22 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql @@ -95,6 +95,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.listing , subq_1.guest , subq_1.host @@ -196,6 +203,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -391,6 +405,13 @@ CROSS JOIN ( , subq_7.metric_time__month , subq_7.metric_time__quarter , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_week + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dayofweek + , subq_7.metric_time__extract_dayofyear , subq_7.listing , subq_7.user , subq_7.listing__user @@ -459,6 +480,13 @@ CROSS JOIN ( , subq_6.ds__month AS metric_time__month , subq_6.ds__quarter AS metric_time__quarter , subq_6.ds__year AS metric_time__year + , subq_6.ds__extract_year AS metric_time__extract_year + , subq_6.ds__extract_quarter AS metric_time__extract_quarter + , subq_6.ds__extract_month AS metric_time__extract_month + , subq_6.ds__extract_week AS metric_time__extract_week + , subq_6.ds__extract_day AS metric_time__extract_day + , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_6.listing , subq_6.user , subq_6.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql index dc0afd0f09..138d3b47ca 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql @@ -116,6 +116,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -338,6 +345,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host @@ -572,6 +586,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -804,6 +825,13 @@ FROM ( , subq_17.ds__month AS metric_time__month , subq_17.ds__quarter AS metric_time__quarter , subq_17.ds__year AS metric_time__year + , subq_17.ds__extract_year AS metric_time__extract_year + , subq_17.ds__extract_quarter AS metric_time__extract_quarter + , subq_17.ds__extract_month AS metric_time__extract_month + , subq_17.ds__extract_week AS metric_time__extract_week + , subq_17.ds__extract_day AS metric_time__extract_day + , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_17.listing , subq_17.guest , subq_17.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql index a53f3a075b..e43e265eff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.verification , subq_0.user , subq_0.verification__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql index 073c7964da..d2a3c6afd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 5f9a321abd..2426067bd3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -123,6 +123,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -307,6 +314,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -484,6 +498,13 @@ FROM ( , subq_10.ds__month AS metric_time__month , subq_10.ds__quarter AS metric_time__quarter , subq_10.ds__year AS metric_time__year + , subq_10.ds__extract_year AS metric_time__extract_year + , subq_10.ds__extract_quarter AS metric_time__extract_quarter + , subq_10.ds__extract_month AS metric_time__extract_month + , subq_10.ds__extract_week AS metric_time__extract_week + , subq_10.ds__extract_day AS metric_time__extract_day + , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_10.listing , subq_10.user , subq_10.view__listing @@ -611,6 +632,13 @@ FROM ( , subq_13.ds__month AS metric_time__month , subq_13.ds__quarter AS metric_time__quarter , subq_13.ds__year AS metric_time__year + , subq_13.ds__extract_year AS metric_time__extract_year + , subq_13.ds__extract_quarter AS metric_time__extract_quarter + , subq_13.ds__extract_month AS metric_time__extract_month + , subq_13.ds__extract_week AS metric_time__extract_week + , subq_13.ds__extract_day AS metric_time__extract_day + , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_13.listing , subq_13.user , subq_13.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql index f52c8d6acf..ad08f90e35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql index 4e79154b70..8c2ab1a915 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql index f44071348d..8d5b07c69a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql @@ -42,6 +42,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql index 4c321e73b0..d98f0f554a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 4821d797fe..26ab44afcc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql index 2a39c9282f..a670ac2189 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql index 82ded0a878..3d88c96009 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -326,6 +333,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql index f21c6e33a7..e2ff275b47 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 34b929887f..13d462ce84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql index 44073119ae..e3607ad97a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 66bd68c2c6..71e89d4432 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 9ab70d9a6a..9967c13e88 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -535,6 +542,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 34b0e577f7..b76e01d113 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -536,6 +543,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql index 390f041085..615aae3ac7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_week AS metric_time__extract_week + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -308,6 +315,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql index 3c8d87a17b..6f115474ac 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql index 3adff18e62..693e200db3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql @@ -114,6 +114,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -298,6 +305,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql index eb70f04221..1a6844636c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -120,6 +120,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -304,6 +311,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql index 246522e063..ff0c914625 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_month AS listing__window_start__extract_month - , subq_4.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_4.window_start__extract_year AS listing__window_start__extract_year + , subq_4.window_end__extract_year AS listing__window_end__extract_year , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -122,6 +122,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -236,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_month - , subq_3.window_end__extract_dayofweek + subq_3.window_start__extract_year + , subq_3.window_end__extract_year , subq_3.listing , subq_3.capacity FROM ( @@ -308,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_month + subq_2.metric_time__day >= subq_4.window_start__extract_year ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_dayofweek + subq_2.metric_time__day < subq_4.window_end__extract_year ) OR ( - subq_4.window_end__extract_dayofweek IS NULL + subq_4.window_end__extract_year IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql index 710e67b149..c37cd61528 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) + subq_12.metric_time__day >= EXTRACT(YEAR FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) + subq_12.metric_time__day < EXTRACT(YEAR FROM listings_src_10017.active_to) ) OR ( - EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) IS NULL + EXTRACT(YEAR FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ef8853985..141c4fba09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql index 29fb5d972e..a2adc126d3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql index 16e8afe8d0..7c85ab1cdb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql index b00d690648..e89a957806 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql @@ -98,6 +98,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql index 583b4a4bf0..436f0e7545 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql @@ -69,6 +69,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.user , subq_0.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql index 437dc887b4..9223eebd6e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql @@ -132,6 +132,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -316,6 +323,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -529,6 +543,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -713,6 +734,13 @@ FROM ( , subq_15.ds__month AS metric_time__month , subq_15.ds__quarter AS metric_time__quarter , subq_15.ds__year AS metric_time__year + , subq_15.ds__extract_year AS metric_time__extract_year + , subq_15.ds__extract_quarter AS metric_time__extract_quarter + , subq_15.ds__extract_month AS metric_time__extract_month + , subq_15.ds__extract_week AS metric_time__extract_week + , subq_15.ds__extract_day AS metric_time__extract_day + , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_15.listing , subq_15.user , subq_15.listing__user @@ -909,6 +937,13 @@ FROM ( , subq_24.ds__month AS metric_time__month , subq_24.ds__quarter AS metric_time__quarter , subq_24.ds__year AS metric_time__year + , subq_24.ds__extract_year AS metric_time__extract_year + , subq_24.ds__extract_quarter AS metric_time__extract_quarter + , subq_24.ds__extract_month AS metric_time__extract_month + , subq_24.ds__extract_week AS metric_time__extract_week + , subq_24.ds__extract_day AS metric_time__extract_day + , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_24.listing , subq_24.guest , subq_24.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql index 9626242169..0512790e47 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql @@ -117,6 +117,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -342,6 +349,13 @@ FROM ( , subq_7.ds__month AS metric_time__month , subq_7.ds__quarter AS metric_time__quarter , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_week AS metric_time__extract_week + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_7.listing , subq_7.guest , subq_7.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql index a495423238..2d8a10e755 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -111,6 +111,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index c868e3cfd9..f000943d3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -292,6 +299,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.user , subq_5.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql index 677ba894bd..6644918147 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_month AS listing__window_start__extract_month - , subq_7.window_end__extract_dayofweek AS listing__window_end__extract_dayofweek + , subq_7.window_start__extract_year AS listing__window_start__extract_year + , subq_7.window_end__extract_year AS listing__window_end__extract_year , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -226,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_month - , subq_6.window_end__extract_dayofweek + subq_6.window_start__extract_year + , subq_6.window_end__extract_year , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -464,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_month + subq_2.metric_time__day >= subq_7.window_start__extract_year ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_dayofweek + subq_2.metric_time__day < subq_7.window_end__extract_year ) OR ( - subq_7.window_end__extract_dayofweek IS NULL + subq_7.window_end__extract_year IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 425b62e62c..8fcb6ec7af 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek + EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_month + subq_13.metric_time__day >= subq_18.window_start__extract_year ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_dayofweek + subq_13.metric_time__day < subq_18.window_end__extract_year ) OR ( - subq_18.window_end__extract_dayofweek IS NULL + subq_18.window_end__extract_year IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql index 72619bc97f..9397ea8d7a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_quarter AS listing__lux_listing__window_start__extract_quarter - , subq_7.lux_listing__window_end__extract_dayofweek AS listing__lux_listing__window_end__extract_dayofweek + , subq_7.lux_listing__window_start__extract_dayofweek AS listing__lux_listing__window_start__extract_dayofweek + , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -229,8 +236,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_quarter - , subq_6.lux_listing__window_end__extract_dayofweek + subq_6.lux_listing__window_start__extract_dayofweek + , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -443,12 +450,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_quarter + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofweek ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_dayofweek + subq_2.metric_time__day < subq_7.lux_listing__window_end__day ) OR ( - subq_7.lux_listing__window_end__extract_dayofweek IS NULL + subq_7.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql index d0d8ae085c..926cc6d3ad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek + EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_quarter + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofweek ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_dayofweek + subq_13.metric_time__day < subq_18.lux_listing__window_end__day ) OR ( - subq_18.lux_listing__window_end__extract_dayofweek IS NULL + subq_18.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql index fbddd59f54..7638105966 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql index eb31a4fb3a..3d8fba9b22 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql @@ -95,6 +95,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.listing , subq_1.guest , subq_1.host @@ -196,6 +203,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -391,6 +405,13 @@ CROSS JOIN ( , subq_7.metric_time__month , subq_7.metric_time__quarter , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_week + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dayofweek + , subq_7.metric_time__extract_dayofyear , subq_7.listing , subq_7.user , subq_7.listing__user @@ -459,6 +480,13 @@ CROSS JOIN ( , subq_6.ds__month AS metric_time__month , subq_6.ds__quarter AS metric_time__quarter , subq_6.ds__year AS metric_time__year + , subq_6.ds__extract_year AS metric_time__extract_year + , subq_6.ds__extract_quarter AS metric_time__extract_quarter + , subq_6.ds__extract_month AS metric_time__extract_month + , subq_6.ds__extract_week AS metric_time__extract_week + , subq_6.ds__extract_day AS metric_time__extract_day + , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_6.listing , subq_6.user , subq_6.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql index dc0afd0f09..138d3b47ca 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql @@ -116,6 +116,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -338,6 +345,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host @@ -572,6 +586,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -804,6 +825,13 @@ FROM ( , subq_17.ds__month AS metric_time__month , subq_17.ds__quarter AS metric_time__quarter , subq_17.ds__year AS metric_time__year + , subq_17.ds__extract_year AS metric_time__extract_year + , subq_17.ds__extract_quarter AS metric_time__extract_quarter + , subq_17.ds__extract_month AS metric_time__extract_month + , subq_17.ds__extract_week AS metric_time__extract_week + , subq_17.ds__extract_day AS metric_time__extract_day + , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_17.listing , subq_17.guest , subq_17.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql index a53f3a075b..e43e265eff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.verification , subq_0.user , subq_0.verification__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql index 073c7964da..d2a3c6afd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index d5d52443ea..c45302afaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -123,6 +123,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -307,6 +314,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -484,6 +498,13 @@ FROM ( , subq_10.ds__month AS metric_time__month , subq_10.ds__quarter AS metric_time__quarter , subq_10.ds__year AS metric_time__year + , subq_10.ds__extract_year AS metric_time__extract_year + , subq_10.ds__extract_quarter AS metric_time__extract_quarter + , subq_10.ds__extract_month AS metric_time__extract_month + , subq_10.ds__extract_week AS metric_time__extract_week + , subq_10.ds__extract_day AS metric_time__extract_day + , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_10.listing , subq_10.user , subq_10.view__listing @@ -611,6 +632,13 @@ FROM ( , subq_13.ds__month AS metric_time__month , subq_13.ds__quarter AS metric_time__quarter , subq_13.ds__year AS metric_time__year + , subq_13.ds__extract_year AS metric_time__extract_year + , subq_13.ds__extract_quarter AS metric_time__extract_quarter + , subq_13.ds__extract_month AS metric_time__extract_month + , subq_13.ds__extract_week AS metric_time__extract_week + , subq_13.ds__extract_day AS metric_time__extract_day + , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_13.listing , subq_13.user , subq_13.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql index f52c8d6acf..ad08f90e35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql index 4e79154b70..8c2ab1a915 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql index f44071348d..8d5b07c69a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql @@ -42,6 +42,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql index 4c321e73b0..d98f0f554a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 4821d797fe..26ab44afcc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql index 2a39c9282f..a670ac2189 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql @@ -45,6 +45,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -80,6 +87,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.user , subq_0.company__user , subq_0.txn_revenue diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql index 82ded0a878..3d88c96009 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -326,6 +333,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql index f21c6e33a7..e2ff275b47 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 34b929887f..13d462ce84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql index 44073119ae..e3607ad97a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 66bd68c2c6..71e89d4432 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -104,6 +104,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -429,6 +436,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 9ab70d9a6a..9967c13e88 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -535,6 +542,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 34b0e577f7..b76e01d113 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -207,6 +207,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -536,6 +543,13 @@ FROM ( , subq_8.ds__month AS metric_time__month , subq_8.ds__quarter AS metric_time__quarter , subq_8.ds__year AS metric_time__year + , subq_8.ds__extract_year AS metric_time__extract_year + , subq_8.ds__extract_quarter AS metric_time__extract_quarter + , subq_8.ds__extract_month AS metric_time__extract_month + , subq_8.ds__extract_week AS metric_time__extract_week + , subq_8.ds__extract_day AS metric_time__extract_day + , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_8.listing , subq_8.guest , subq_8.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql index 390f041085..615aae3ac7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter , subq_1.metric_time__year AS metric_time__year + , subq_1.metric_time__extract_year AS metric_time__extract_year + , subq_1.metric_time__extract_quarter AS metric_time__extract_quarter + , subq_1.metric_time__extract_month AS metric_time__extract_month + , subq_1.metric_time__extract_week AS metric_time__extract_week + , subq_1.metric_time__extract_day AS metric_time__extract_day + , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -308,6 +315,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql index 3c8d87a17b..6f115474ac 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -201,6 +201,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql index 3adff18e62..693e200db3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql @@ -114,6 +114,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -298,6 +305,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql index eb70f04221..1a6844636c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -120,6 +120,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -304,6 +311,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql index f7de81777d..dbe82316e7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql @@ -31,7 +31,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_4.window_start__extract_month AS listing__window_start__extract_month - , subq_4.window_end__extract_day AS listing__window_end__extract_day + , subq_4.window_end__extract_month AS listing__window_end__extract_month , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -122,6 +122,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -237,7 +244,7 @@ FROM ( -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT subq_3.window_start__extract_month - , subq_3.window_end__extract_day + , subq_3.window_end__extract_month , subq_3.listing , subq_3.capacity FROM ( @@ -311,9 +318,9 @@ FROM ( subq_2.metric_time__day >= subq_4.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_day + subq_2.metric_time__day < subq_4.window_end__extract_month ) OR ( - subq_4.window_end__extract_day IS NULL + subq_4.window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql index 8e679fa648..24f243f464 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql @@ -35,9 +35,9 @@ FROM ( subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) ) AND ( ( - subq_12.metric_time__day < EXTRACT(DAY FROM listings_src_10017.active_to) + subq_12.metric_time__day < EXTRACT(MONTH FROM listings_src_10017.active_to) ) OR ( - EXTRACT(DAY FROM listings_src_10017.active_to) IS NULL + EXTRACT(MONTH FROM listings_src_10017.active_to) IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 6ef8853985..141c4fba09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql index 29fb5d972e..a2adc126d3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql index 16e8afe8d0..7c85ab1cdb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql @@ -109,6 +109,13 @@ INNER JOIN ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql index b00d690648..e89a957806 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql @@ -98,6 +98,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql index 583b4a4bf0..436f0e7545 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql @@ -69,6 +69,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.user , subq_0.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql index 437dc887b4..9223eebd6e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql @@ -132,6 +132,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -316,6 +323,13 @@ FROM ( , 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.ds__extract_year AS metric_time__extract_year + , subq_3.ds__extract_quarter AS metric_time__extract_quarter + , subq_3.ds__extract_month AS metric_time__extract_month + , subq_3.ds__extract_week AS metric_time__extract_week + , subq_3.ds__extract_day AS metric_time__extract_day + , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_3.listing , subq_3.user , subq_3.listing__user @@ -529,6 +543,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -713,6 +734,13 @@ FROM ( , subq_15.ds__month AS metric_time__month , subq_15.ds__quarter AS metric_time__quarter , subq_15.ds__year AS metric_time__year + , subq_15.ds__extract_year AS metric_time__extract_year + , subq_15.ds__extract_quarter AS metric_time__extract_quarter + , subq_15.ds__extract_month AS metric_time__extract_month + , subq_15.ds__extract_week AS metric_time__extract_week + , subq_15.ds__extract_day AS metric_time__extract_day + , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_15.listing , subq_15.user , subq_15.listing__user @@ -909,6 +937,13 @@ FROM ( , subq_24.ds__month AS metric_time__month , subq_24.ds__quarter AS metric_time__quarter , subq_24.ds__year AS metric_time__year + , subq_24.ds__extract_year AS metric_time__extract_year + , subq_24.ds__extract_quarter AS metric_time__extract_quarter + , subq_24.ds__extract_month AS metric_time__extract_month + , subq_24.ds__extract_week AS metric_time__extract_week + , subq_24.ds__extract_day AS metric_time__extract_day + , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_24.listing , subq_24.guest , subq_24.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql index 37ad3a608e..1f9e7a4524 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql @@ -117,6 +117,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -342,6 +349,13 @@ FROM ( , subq_7.ds__month AS metric_time__month , subq_7.ds__quarter AS metric_time__quarter , subq_7.ds__year AS metric_time__year + , subq_7.ds__extract_year AS metric_time__extract_year + , subq_7.ds__extract_quarter AS metric_time__extract_quarter + , subq_7.ds__extract_month AS metric_time__extract_month + , subq_7.ds__extract_week AS metric_time__extract_week + , subq_7.ds__extract_day AS metric_time__extract_day + , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_7.listing , subq_7.guest , subq_7.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql index a495423238..2d8a10e755 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -111,6 +111,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 0e4cdb1a6a..4ef0714be2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -292,6 +299,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.user , subq_5.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql index 7509855402..a4dc109e27 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql @@ -21,7 +21,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_7.window_start__extract_month AS listing__window_start__extract_month - , subq_7.window_end__extract_day AS listing__window_end__extract_day + , subq_7.window_end__extract_month AS listing__window_end__extract_month , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -227,7 +234,7 @@ FROM ( -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT subq_6.window_start__extract_month - , subq_6.window_end__extract_day + , subq_6.window_end__extract_month , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -467,9 +474,9 @@ FROM ( subq_2.metric_time__day >= subq_7.window_start__extract_month ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_day + subq_2.metric_time__day < subq_7.window_end__extract_month ) OR ( - subq_7.window_end__extract_day IS NULL + subq_7.window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql index dac9dfcf79..004fe3196a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -24,7 +24,7 @@ LEFT OUTER JOIN ( -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -41,9 +41,9 @@ ON subq_13.metric_time__day >= subq_18.window_start__extract_month ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_day + subq_13.metric_time__day < subq_18.window_end__extract_month ) OR ( - subq_18.window_end__extract_day IS NULL + subq_18.window_end__extract_month IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql index 27cc3589f7..a3b53ef6af 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_month AS listing__lux_listing__window_start__extract_month - , subq_7.lux_listing__window_end__extract_week AS listing__lux_listing__window_end__extract_week + , subq_7.lux_listing__window_start__extract_dayofyear AS listing__lux_listing__window_start__extract_dayofyear + , subq_7.lux_listing__window_end__extract_quarter AS listing__lux_listing__window_end__extract_quarter , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -112,6 +112,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -229,8 +236,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_month - , subq_6.lux_listing__window_end__extract_week + subq_6.lux_listing__window_start__extract_dayofyear + , subq_6.lux_listing__window_end__extract_quarter , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -443,12 +450,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_month + subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofyear ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_week + subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_quarter ) OR ( - subq_7.lux_listing__window_end__extract_week IS NULL + subq_7.lux_listing__window_end__extract_quarter IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql index f84156c6f9..8dc33d857c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_month + subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofyear ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_week + subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_quarter ) OR ( - subq_18.lux_listing__window_end__extract_week IS NULL + subq_18.lux_listing__window_end__extract_quarter IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql index fbddd59f54..7638105966 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql index eb31a4fb3a..3d8fba9b22 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql @@ -95,6 +95,13 @@ FROM ( , subq_1.metric_time__month , subq_1.metric_time__quarter , subq_1.metric_time__year + , subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dayofweek + , subq_1.metric_time__extract_dayofyear , subq_1.listing , subq_1.guest , subq_1.host @@ -196,6 +203,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -391,6 +405,13 @@ CROSS JOIN ( , subq_7.metric_time__month , subq_7.metric_time__quarter , subq_7.metric_time__year + , subq_7.metric_time__extract_year + , subq_7.metric_time__extract_quarter + , subq_7.metric_time__extract_month + , subq_7.metric_time__extract_week + , subq_7.metric_time__extract_day + , subq_7.metric_time__extract_dayofweek + , subq_7.metric_time__extract_dayofyear , subq_7.listing , subq_7.user , subq_7.listing__user @@ -459,6 +480,13 @@ CROSS JOIN ( , subq_6.ds__month AS metric_time__month , subq_6.ds__quarter AS metric_time__quarter , subq_6.ds__year AS metric_time__year + , subq_6.ds__extract_year AS metric_time__extract_year + , subq_6.ds__extract_quarter AS metric_time__extract_quarter + , subq_6.ds__extract_month AS metric_time__extract_month + , subq_6.ds__extract_week AS metric_time__extract_week + , subq_6.ds__extract_day AS metric_time__extract_day + , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_6.listing , subq_6.user , subq_6.listing__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql index dc0afd0f09..138d3b47ca 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql @@ -116,6 +116,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -338,6 +345,13 @@ FROM ( , subq_5.ds__month AS metric_time__month , subq_5.ds__quarter AS metric_time__quarter , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host @@ -572,6 +586,13 @@ FROM ( , subq_12.ds__month AS metric_time__month , subq_12.ds__quarter AS metric_time__quarter , subq_12.ds__year AS metric_time__year + , subq_12.ds__extract_year AS metric_time__extract_year + , subq_12.ds__extract_quarter AS metric_time__extract_quarter + , subq_12.ds__extract_month AS metric_time__extract_month + , subq_12.ds__extract_week AS metric_time__extract_week + , subq_12.ds__extract_day AS metric_time__extract_day + , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_12.listing , subq_12.guest , subq_12.host @@ -804,6 +825,13 @@ FROM ( , subq_17.ds__month AS metric_time__month , subq_17.ds__quarter AS metric_time__quarter , subq_17.ds__year AS metric_time__year + , subq_17.ds__extract_year AS metric_time__extract_year + , subq_17.ds__extract_quarter AS metric_time__extract_quarter + , subq_17.ds__extract_month AS metric_time__extract_month + , subq_17.ds__extract_week AS metric_time__extract_week + , subq_17.ds__extract_day AS metric_time__extract_day + , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_17.listing , subq_17.guest , subq_17.host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql index a53f3a075b..e43e265eff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql @@ -84,6 +84,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.verification , subq_0.user , subq_0.verification__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml index c0830e210b..97591729c5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml @@ -31,11 +31,11 @@ - + - + @@ -44,7 +44,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -63,11 +63,11 @@ - + - + @@ -76,395 +76,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -864,11 +892,11 @@ - + - + @@ -877,7 +905,7 @@ - + @@ -886,7 +914,7 @@ - + @@ -896,11 +924,11 @@ - + - + @@ -909,395 +937,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml index 9315fdef74..7fc551df80 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -29,11 +29,11 @@ - + - + @@ -48,15 +48,15 @@ - + - + - + @@ -65,11 +65,11 @@ - + - + @@ -78,11 +78,11 @@ - + - + @@ -92,15 +92,15 @@ - + - + - + @@ -109,19 +109,19 @@ - + - + - + - + @@ -138,15 +138,15 @@ - + - + - + @@ -155,395 +155,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -943,11 +971,11 @@ - + - + @@ -956,263 +984,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1478,15 +1534,15 @@ - + - + - + @@ -1495,11 +1551,11 @@ - + - + @@ -1508,11 +1564,11 @@ - + - + @@ -1522,15 +1578,15 @@ - + - + - + @@ -1539,19 +1595,19 @@ - + - + - + - + @@ -1568,15 +1624,15 @@ - + - + - + @@ -1585,235 +1641,263 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2049,11 +2133,11 @@ - + - + @@ -2062,263 +2146,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml index 767372469e..37c8fa43eb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,131 +49,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml index 0ee72e4356..5dc0f7e4cf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,131 +49,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml index 02d428e68a..ea17474430 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml @@ -4,7 +4,7 @@ - + @@ -24,7 +24,7 @@ - + @@ -33,131 +33,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml index a5c78af24a..e1894ad698 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,131 +49,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml index 836bc1a09c..015b695d28 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -50,131 +50,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -183,131 +211,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml index db9917690c..dfb4ab1ff7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -50,131 +50,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -183,131 +211,159 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml index 47028f82c6..dd9355e958 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,395 +85,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -873,11 +901,11 @@ - + - + @@ -886,7 +914,7 @@ - + @@ -895,7 +923,7 @@ - + @@ -905,11 +933,11 @@ - + - + @@ -918,395 +946,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml index 9b112de652..d630756d83 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,395 +85,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -873,11 +901,11 @@ - + - + @@ -886,7 +914,7 @@ - + @@ -895,7 +923,7 @@ - + @@ -905,11 +933,11 @@ - + - + @@ -918,379 +946,379 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1305,7 +1333,7 @@ - + @@ -1320,395 +1348,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml index 50437f494c..62931da30f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,395 +85,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -873,11 +901,11 @@ - + - + @@ -886,7 +914,7 @@ - + @@ -895,7 +923,7 @@ - + @@ -905,11 +933,11 @@ - + - + @@ -922,375 +950,375 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1305,7 +1333,7 @@ - + @@ -1320,395 +1348,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml index c61572cec8..f0fad5688e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,395 +85,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -873,11 +901,11 @@ - + - + @@ -886,7 +914,7 @@ - + @@ -895,7 +923,7 @@ - + @@ -905,11 +933,11 @@ - + - + @@ -918,379 +946,379 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1305,7 +1333,7 @@ - + @@ -1320,395 +1348,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml index ab7df49f61..df2164f79a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,395 +85,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -873,11 +901,11 @@ - + - + @@ -886,7 +914,7 @@ - + @@ -895,7 +923,7 @@ - + @@ -905,11 +933,11 @@ - + - + @@ -922,375 +950,375 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1305,7 +1333,7 @@ - + @@ -1320,395 +1348,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml index 964ca40404..aec16b0428 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,379 +85,379 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -472,7 +472,7 @@ - + @@ -487,395 +487,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -1276,11 +1304,11 @@ - + - + @@ -1289,7 +1317,7 @@ - + @@ -1298,7 +1326,7 @@ - + @@ -1308,11 +1336,11 @@ - + - + @@ -1321,379 +1349,379 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1708,7 +1736,7 @@ - + @@ -1723,395 +1751,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml index bf2ebf93fd..600937f011 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -89,375 +89,375 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -472,7 +472,7 @@ - + @@ -487,395 +487,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -1276,11 +1304,11 @@ - + - + @@ -1289,7 +1317,7 @@ - + @@ -1298,7 +1326,7 @@ - + @@ -1308,11 +1336,11 @@ - + - + @@ -1325,375 +1353,375 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1708,7 +1736,7 @@ - + @@ -1723,395 +1751,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml index b4604d9a7a..30d603cdd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,379 +62,379 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -449,7 +449,7 @@ - + @@ -464,395 +464,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -867,7 +895,7 @@ - + @@ -882,395 +910,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml index edcddda734..3a6e566a97 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,379 +62,379 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -449,7 +449,7 @@ - + @@ -464,395 +464,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml index 07444a9b99..b0116367f0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml @@ -4,13 +4,13 @@ - + - + @@ -19,7 +19,7 @@ - + @@ -28,11 +28,11 @@ - + - + @@ -41,7 +41,7 @@ - + @@ -50,7 +50,7 @@ - + @@ -60,11 +60,11 @@ - + - + @@ -73,15 +73,15 @@ - + - + - + @@ -98,11 +98,11 @@ - + - + @@ -111,395 +111,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -899,11 +927,11 @@ - + - + @@ -912,263 +940,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml index 38e7f01169..a809f0c726 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,15 +49,15 @@ - + - + - + @@ -69,15 +69,15 @@ - + - + - + @@ -86,19 +86,19 @@ - + - + - + - + @@ -115,15 +115,15 @@ - + - + - + @@ -132,395 +132,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -920,11 +948,11 @@ - + - + @@ -933,263 +961,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml index bc1b1e86fe..9cc83dfb26 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,15 +49,15 @@ - + - + - + @@ -69,15 +69,15 @@ - + - + - + @@ -86,27 +86,27 @@ - + - - - - + + + + - + - + - + - + @@ -123,15 +123,15 @@ - + - + - + @@ -140,371 +140,399 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -880,19 +908,19 @@ - - + + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml index d707b51e98..deb1256c84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -27,7 +27,7 @@ - + @@ -42,11 +42,11 @@ - + - + @@ -59,11 +59,11 @@ - + - + @@ -72,11 +72,11 @@ - + - + @@ -84,18 +84,18 @@ - - - - + + + + - + - - - - + + + + @@ -412,84 +412,112 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml index d707b51e98..deb1256c84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -27,7 +27,7 @@ - + @@ -42,11 +42,11 @@ - + - + @@ -59,11 +59,11 @@ - + - + @@ -72,11 +72,11 @@ - + - + @@ -84,18 +84,18 @@ - - - - + + + + - + - - - - + + + + @@ -412,84 +412,112 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml index d707b51e98..deb1256c84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -27,7 +27,7 @@ - + @@ -42,11 +42,11 @@ - + - + @@ -59,11 +59,11 @@ - + - + @@ -72,11 +72,11 @@ - + - + @@ -84,18 +84,18 @@ - - - - + + + + - + - - - - + + + + @@ -412,84 +412,112 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml index eb918937d1..0c0b947455 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,395 +62,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml index 0c406fa13f..90cd7de9ba 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,263 +49,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml index 861a4944cd..2d8e684ff8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml @@ -2,10 +2,10 @@ - - - - + + + + @@ -21,16 +21,16 @@ - + - + - - - - + + + + @@ -50,11 +50,11 @@ - + - + @@ -63,7 +63,7 @@ - + @@ -72,7 +72,7 @@ - + @@ -82,11 +82,11 @@ - + - + @@ -95,15 +95,15 @@ - + - + - + @@ -115,15 +115,15 @@ - + - + - + @@ -132,19 +132,19 @@ - + - + - + - + @@ -161,15 +161,15 @@ - + - + - + @@ -178,395 +178,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -966,11 +994,11 @@ - + - + @@ -979,263 +1007,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1503,11 +1559,11 @@ - + - + @@ -1516,7 +1572,7 @@ - + @@ -1525,7 +1581,7 @@ - + @@ -1535,11 +1591,11 @@ - + - + @@ -1548,15 +1604,15 @@ - + - + - + @@ -1568,15 +1624,15 @@ - + - + - + @@ -1585,19 +1641,19 @@ - + - + - + - + @@ -1614,15 +1670,15 @@ - + - + - + @@ -1631,395 +1687,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -2419,11 +2503,11 @@ - + - + @@ -2432,263 +2516,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2956,11 +3068,11 @@ - + - + @@ -2969,7 +3081,7 @@ - + @@ -2978,7 +3090,7 @@ - + @@ -2988,11 +3100,11 @@ - + - + @@ -3001,395 +3113,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml index 44372c125e..abe224335b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,11 +21,11 @@ - + - + @@ -40,11 +40,11 @@ - + - + @@ -53,7 +53,7 @@ - + @@ -62,7 +62,7 @@ - + @@ -72,11 +72,11 @@ - + - + @@ -85,15 +85,15 @@ - + - + - + @@ -105,15 +105,15 @@ - + - + - + @@ -122,395 +122,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -912,11 +940,11 @@ - + - + @@ -925,7 +953,7 @@ - + @@ -934,7 +962,7 @@ - + @@ -944,11 +972,11 @@ - + - + @@ -957,395 +985,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml index c22e5aaa2c..05c1e14185 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml @@ -4,7 +4,7 @@ - + @@ -17,11 +17,11 @@ - + - + @@ -30,7 +30,7 @@ - + @@ -39,7 +39,7 @@ - + @@ -49,11 +49,11 @@ - + - + @@ -62,15 +62,15 @@ - + - + - + @@ -82,15 +82,15 @@ - + - + - + @@ -99,395 +99,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml index 700630d85f..ea838d4c06 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml @@ -13,11 +13,11 @@ - + - + @@ -32,7 +32,7 @@ - + @@ -52,7 +52,7 @@ - + @@ -61,395 +61,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -849,7 +877,7 @@ - + @@ -869,7 +897,7 @@ - + @@ -878,263 +906,291 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml index 0925971c02..0f3e05153d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -21,11 +21,11 @@ - + - + @@ -34,11 +34,11 @@ - + - + @@ -48,15 +48,15 @@ - + - + - + @@ -65,27 +65,27 @@ - + - - - - + + + + - + - + - + - + @@ -102,15 +102,15 @@ - + - + - + @@ -119,371 +119,399 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -859,19 +887,19 @@ - - + + - + - + - + @@ -880,283 +908,283 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1438,111 +1466,111 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml index e26de6a7d9..d506931ba5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml @@ -4,15 +4,15 @@ - + - + - + @@ -21,11 +21,11 @@ - + - + @@ -34,11 +34,11 @@ - + - + @@ -48,15 +48,15 @@ - + - + - + @@ -65,27 +65,27 @@ - + - - - - - - - - + + + + + + + + - + - + - + @@ -102,15 +102,15 @@ - + - + - + @@ -119,371 +119,399 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -860,21 +888,21 @@ - - - - - - - - + + + + + + + + - + - + @@ -883,115 +911,115 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -1082,207 +1110,207 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml index 9f9193531e..8646094e2a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,23 +49,23 @@ - + - + - + - + - + @@ -82,15 +82,15 @@ - + - + - + @@ -99,231 +99,259 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -555,15 +583,15 @@ - + - + - + @@ -572,175 +600,175 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -912,119 +940,119 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml index cbd37b5a97..91382c7f6c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml @@ -21,10 +21,10 @@ - - - - + + + + @@ -41,10 +41,10 @@ - - - - + + + + @@ -53,395 +53,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -450,395 +478,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -1239,7 +1295,7 @@ - + @@ -1259,7 +1315,7 @@ - + @@ -1269,529 +1325,585 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml index ebf9d2d655..dbf66e4cac 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml @@ -4,7 +4,7 @@ - + @@ -21,15 +21,15 @@ - + - + - + @@ -50,7 +50,7 @@ - + @@ -67,11 +67,11 @@ - + - + @@ -86,11 +86,11 @@ - + - + @@ -99,7 +99,7 @@ - + @@ -108,7 +108,7 @@ - + @@ -118,11 +118,11 @@ - + - + @@ -131,395 +131,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -919,11 +947,11 @@ - + - + @@ -932,7 +960,7 @@ - + @@ -941,7 +969,7 @@ - + @@ -951,11 +979,11 @@ - + - + @@ -964,395 +992,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -1754,11 +1810,11 @@ - + - + @@ -1767,7 +1823,7 @@ - + @@ -1776,7 +1832,7 @@ - + @@ -1786,11 +1842,11 @@ - + - + @@ -1799,395 +1855,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -2587,11 +2671,11 @@ - + - + @@ -2600,7 +2684,7 @@ - + @@ -2609,7 +2693,7 @@ - + @@ -2619,11 +2703,11 @@ - + - + @@ -2632,395 +2716,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml index 175032c65b..8b5700c40e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml @@ -4,11 +4,11 @@ - + - + @@ -17,7 +17,7 @@ - + @@ -26,7 +26,7 @@ - + @@ -36,11 +36,11 @@ - + - + @@ -49,23 +49,23 @@ - + - + - + - + - + @@ -82,15 +82,15 @@ - + - + - + @@ -99,239 +99,267 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -571,15 +599,15 @@ - + - + - + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 343e8eb274..6eb1db1ad8 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.paid_at__month AS metric_time__month , subq_0.paid_at__quarter AS metric_time__quarter , subq_0.paid_at__year AS metric_time__year + , subq_0.paid_at__extract_year AS metric_time__extract_year + , subq_0.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_0.paid_at__extract_month AS metric_time__extract_month + , subq_0.paid_at__extract_week AS metric_time__extract_week + , subq_0.paid_at__extract_day AS metric_time__extract_day + , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 6e9ffdb258..25222a0a63 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC(paid_at, month) AS metric_time__month , DATE_TRUNC(paid_at, quarter) AS metric_time__quarter , DATE_TRUNC(paid_at, year) AS metric_time__year + , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year + , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month + , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 1d6c177790..07a5a8e779 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index ac5f560577..49d41bb5d7 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC(ds, month) AS metric_time__month , DATE_TRUNC(ds, quarter) AS metric_time__quarter , DATE_TRUNC(ds, year) AS metric_time__year + , EXTRACT(YEAR FROM ds) AS metric_time__extract_year + , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM ds) AS metric_time__extract_month + , EXTRACT(WEEK FROM ds) AS metric_time__extract_week + , EXTRACT(DAY FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql index 95a2765eec..7b4716534b 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.paid_at__month AS metric_time__month , subq_5.paid_at__quarter AS metric_time__quarter , subq_5.paid_at__year AS metric_time__year + , subq_5.paid_at__extract_year AS metric_time__extract_year + , subq_5.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_5.paid_at__extract_month AS metric_time__extract_month + , subq_5.paid_at__extract_week AS metric_time__extract_week + , subq_5.paid_at__extract_day AS metric_time__extract_day + , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 7546e82b35..5bbf8cbab3 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.paid_at__month AS metric_time__month , subq_0.paid_at__quarter AS metric_time__quarter , subq_0.paid_at__year AS metric_time__year + , subq_0.paid_at__extract_year AS metric_time__extract_year + , subq_0.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_0.paid_at__extract_month AS metric_time__extract_month + , subq_0.paid_at__extract_week AS metric_time__extract_week + , subq_0.paid_at__extract_day AS metric_time__extract_day + , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/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/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index dd88a042dc..746c7caf59 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/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/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year + , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year + , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month + , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek + , EXTRACT(DOY FROM paid_at) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index e3908e0d03..bb677b5714 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index e739399f60..d67732107d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year + , EXTRACT(YEAR FROM ds) AS metric_time__extract_year + , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM ds) AS metric_time__extract_month + , EXTRACT(WEEK FROM ds) AS metric_time__extract_week + , EXTRACT(DAY FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , EXTRACT(DOY FROM ds) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql index 08e9c6f6fa..a7e28bf336 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.paid_at__month AS metric_time__month , subq_5.paid_at__quarter AS metric_time__quarter , subq_5.paid_at__year AS metric_time__year + , subq_5.paid_at__extract_year AS metric_time__extract_year + , subq_5.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_5.paid_at__extract_month AS metric_time__extract_month + , subq_5.paid_at__extract_week AS metric_time__extract_week + , subq_5.paid_at__extract_day AS metric_time__extract_day + , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 4f359630e6..b9c1d34bad 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.paid_at__month AS metric_time__month , subq_0.paid_at__quarter AS metric_time__quarter , subq_0.paid_at__year AS metric_time__year + , subq_0.paid_at__extract_year AS metric_time__extract_year + , subq_0.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_0.paid_at__extract_month AS metric_time__extract_month + , subq_0.paid_at__extract_week AS metric_time__extract_week + , subq_0.paid_at__extract_day AS metric_time__extract_day + , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index ed2c8def7c..9326cd820a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year + , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year + , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month + , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 3acc2d08e5..a2a9795f0c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 541c754a5a..30a42573dd 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year + , EXTRACT(YEAR FROM ds) AS metric_time__extract_year + , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM ds) AS metric_time__extract_month + , EXTRACT(WEEK FROM ds) AS metric_time__extract_week + , EXTRACT(DAY FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql index 9a64eefccb..4b399298d5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.paid_at__month AS metric_time__month , subq_5.paid_at__quarter AS metric_time__quarter , subq_5.paid_at__year AS metric_time__year + , subq_5.paid_at__extract_year AS metric_time__extract_year + , subq_5.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_5.paid_at__extract_month AS metric_time__extract_month + , subq_5.paid_at__extract_week AS metric_time__extract_week + , subq_5.paid_at__extract_day AS metric_time__extract_day + , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 4f359630e6..b9c1d34bad 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.paid_at__month AS metric_time__month , subq_0.paid_at__quarter AS metric_time__quarter , subq_0.paid_at__year AS metric_time__year + , subq_0.paid_at__extract_year AS metric_time__extract_year + , subq_0.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_0.paid_at__extract_month AS metric_time__extract_month + , subq_0.paid_at__extract_week AS metric_time__extract_week + , subq_0.paid_at__extract_day AS metric_time__extract_day + , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/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/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index ed2c8def7c..9326cd820a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/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/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year + , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year + , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month + , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 3acc2d08e5..a2a9795f0c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 541c754a5a..30a42573dd 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year + , EXTRACT(YEAR FROM ds) AS metric_time__extract_year + , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM ds) AS metric_time__extract_month + , EXTRACT(WEEK FROM ds) AS metric_time__extract_week + , EXTRACT(DAY FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql index 9a64eefccb..4b399298d5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.paid_at__month AS metric_time__month , subq_5.paid_at__quarter AS metric_time__quarter , subq_5.paid_at__year AS metric_time__year + , subq_5.paid_at__extract_year AS metric_time__extract_year + , subq_5.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_5.paid_at__extract_month AS metric_time__extract_month + , subq_5.paid_at__extract_week AS metric_time__extract_week + , subq_5.paid_at__extract_day AS metric_time__extract_day + , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 4f359630e6..b9c1d34bad 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.paid_at__month AS metric_time__month , subq_0.paid_at__quarter AS metric_time__quarter , subq_0.paid_at__year AS metric_time__year + , subq_0.paid_at__extract_year AS metric_time__extract_year + , subq_0.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_0.paid_at__extract_month AS metric_time__extract_month + , subq_0.paid_at__extract_week AS metric_time__extract_week + , subq_0.paid_at__extract_day AS metric_time__extract_day + , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/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/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index ed2c8def7c..9326cd820a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/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/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year + , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year + , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month + , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 3acc2d08e5..a2a9795f0c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 541c754a5a..30a42573dd 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year + , EXTRACT(YEAR FROM ds) AS metric_time__extract_year + , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM ds) AS metric_time__extract_month + , EXTRACT(WEEK FROM ds) AS metric_time__extract_week + , EXTRACT(DAY FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql index 9a64eefccb..4b399298d5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.paid_at__month AS metric_time__month , subq_5.paid_at__quarter AS metric_time__quarter , subq_5.paid_at__year AS metric_time__year + , subq_5.paid_at__extract_year AS metric_time__extract_year + , subq_5.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_5.paid_at__extract_month AS metric_time__extract_month + , subq_5.paid_at__extract_week AS metric_time__extract_week + , subq_5.paid_at__extract_day AS metric_time__extract_day + , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 4f359630e6..b9c1d34bad 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.paid_at__month AS metric_time__month , subq_0.paid_at__quarter AS metric_time__quarter , subq_0.paid_at__year AS metric_time__year + , subq_0.paid_at__extract_year AS metric_time__extract_year + , subq_0.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_0.paid_at__extract_month AS metric_time__extract_month + , subq_0.paid_at__extract_week AS metric_time__extract_week + , subq_0.paid_at__extract_day AS metric_time__extract_day + , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/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/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index ed2c8def7c..9326cd820a 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/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/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year + , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year + , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month + , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 3acc2d08e5..a2a9795f0c 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -77,6 +77,13 @@ SELECT , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 541c754a5a..30a42573dd 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -78,6 +78,13 @@ SELECT , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year + , EXTRACT(YEAR FROM ds) AS metric_time__extract_year + , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter + , EXTRACT(MONTH FROM ds) AS metric_time__extract_month + , EXTRACT(WEEK FROM ds) AS metric_time__extract_week + , EXTRACT(DAY FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql index 9a64eefccb..4b399298d5 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql @@ -99,6 +99,13 @@ FROM ( , subq_0.ds__month AS metric_time__month , subq_0.ds__quarter AS metric_time__quarter , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek + , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear , subq_0.listing , subq_0.guest , subq_0.host @@ -321,6 +328,13 @@ FULL OUTER JOIN ( , subq_5.paid_at__month AS metric_time__month , subq_5.paid_at__quarter AS metric_time__quarter , subq_5.paid_at__year AS metric_time__year + , subq_5.paid_at__extract_year AS metric_time__extract_year + , subq_5.paid_at__extract_quarter AS metric_time__extract_quarter + , subq_5.paid_at__extract_month AS metric_time__extract_month + , subq_5.paid_at__extract_week AS metric_time__extract_week + , subq_5.paid_at__extract_day AS metric_time__extract_day + , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek + , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear , subq_5.listing , subq_5.guest , subq_5.host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml index c9e54613ef..b7325320f3 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml @@ -313,36 +313,64 @@ - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml index e540f55e93..bedd5ead3d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml @@ -313,84 +313,112 @@ - + - + - + - + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml index 14997b6627..be05efe8ce 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml @@ -31,11 +31,11 @@ - + - + @@ -44,7 +44,7 @@ - + @@ -53,7 +53,7 @@ - + @@ -63,11 +63,11 @@ - + - + @@ -76,395 +76,423 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + @@ -864,11 +892,11 @@ - + - + @@ -877,7 +905,7 @@ - + @@ -886,7 +914,7 @@ - + @@ -896,11 +924,11 @@ - + - + @@ -909,347 +937,375 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt b/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt index 08f466a809..11a7d2fd95 100644 --- a/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt +++ b/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt @@ -1,10 +1,24 @@ ['company__ds__day', + 'company__ds__day', + 'company__ds__day', + 'company__ds__day', + 'company__ds__day', + 'company__ds__day', + 'company__ds__day', + 'company__ds__day', 'company__ds__month', 'company__ds__quarter', 'company__ds__week', 'company__ds__year', 'company__user', 'ds__day', + 'ds__day', + 'ds__day', + 'ds__day', + 'ds__day', + 'ds__day', + 'ds__day', + 'ds__day', 'ds__month', 'ds__quarter', 'ds__week', @@ -12,6 +26,13 @@ 'txn_revenue', 'user', 'user__ds__day', + 'user__ds__day', + 'user__ds__day', + 'user__ds__day', + 'user__ds__day', + 'user__ds__day', + 'user__ds__day', + 'user__ds__day', 'user__ds__month', 'user__ds__quarter', 'user__ds__week', diff --git a/metricflow/time/time_granularity.py b/metricflow/time/time_granularity.py index c96909d375..a08beb2431 100644 --- a/metricflow/time/time_granularity.py +++ b/metricflow/time/time_granularity.py @@ -36,7 +36,7 @@ def is_period_start(time_granularity: TimeGranularity, date: Union[pd.Timestamp, if time_granularity is TimeGranularity.DAY: return True elif time_granularity is TimeGranularity.WEEK: - return ISODAYOFWEEK.from_pandas_timestamp(pd_date).is_week_start + return ISOWeekDay.from_pandas_timestamp(pd_date).is_week_start elif time_granularity is TimeGranularity.MONTH: return pd_date.is_month_start elif time_granularity is TimeGranularity.QUARTER: @@ -53,7 +53,7 @@ def is_period_end(time_granularity: TimeGranularity, date: Union[pd.Timestamp, d if time_granularity is TimeGranularity.DAY: return True elif time_granularity is TimeGranularity.WEEK: - return ISODAYOFWEEK.from_pandas_timestamp(pd_date).is_week_end + return ISOWeekDay.from_pandas_timestamp(pd_date).is_week_end elif time_granularity is TimeGranularity.MONTH: return pd_date.is_month_end elif time_granularity is TimeGranularity.QUARTER: @@ -70,7 +70,7 @@ def period_begin_offset( # noqa: D if time_granularity is TimeGranularity.DAY: raise ValueError(f"Can't get period start offset for TimeGranularity.{time_granularity.name}.") elif time_granularity is TimeGranularity.WEEK: - return pd.offsets.Week(dayofweek=ISODAYOFWEEK.MONDAY.pandas_value) + return pd.offsets.Week(weekday=ISOWeekDay.MONDAY.pandas_value) elif time_granularity is TimeGranularity.MONTH: return pd.offsets.MonthBegin() elif time_granularity is TimeGranularity.QUARTER: @@ -87,7 +87,7 @@ def period_end_offset( # noqa: D if time_granularity is TimeGranularity.DAY: raise ValueError(f"Can't get period end offset for TimeGranularity.{time_granularity.name}.") elif time_granularity == TimeGranularity.WEEK: - return pd.offsets.Week(dayofweek=ISODAYOFWEEK.SUNDAY.pandas_value) + return pd.offsets.Week(weekday=ISOWeekDay.SUNDAY.pandas_value) elif time_granularity is TimeGranularity.MONTH: return pd.offsets.MonthEnd() elif time_granularity is TimeGranularity.QUARTER: @@ -132,7 +132,7 @@ def match_start_or_end_of_period( ) -class ISODAYOFWEEK(ExtendedEnum): +class ISOWeekDay(ExtendedEnum): """Day of week values per ISO standard.""" MONDAY = 1 @@ -144,23 +144,23 @@ class ISODAYOFWEEK(ExtendedEnum): SUNDAY = 7 @staticmethod - def from_pandas_timestamp(timestamp: pd.Timestamp) -> ISODAYOFWEEK: - """Factory for streamlining conversion from a Pandas Timestamp to an ISODAYOFWEEK.""" - return ISODAYOFWEEK(timestamp.isodayofweek()) + def from_pandas_timestamp(timestamp: pd.Timestamp) -> ISOWeekDay: + """Factory for streamlining conversion from a Pandas Timestamp to an ISOWeekDay.""" + return ISOWeekDay(timestamp.isoweekday()) @property def is_week_start(self) -> bool: """Return comparison of instance value against ISO standard start of week (Monday).""" - return self is ISODAYOFWEEK.MONDAY + return self is ISOWeekDay.MONDAY @property def is_week_end(self) -> bool: """Return comparison of instance value against ISO standard end of week (Sunday).""" - return self is ISODAYOFWEEK.SUNDAY + return self is ISOWeekDay.SUNDAY @property def pandas_value(self) -> int: - """Returns the pandas int value representation of the ISODAYOFWEEK.""" + """Returns the pandas int value representation of the ISOWeekDay.""" return self.value - 1 From 07af19a86f1d65b713f76434192b93c8071b54a4 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 13:48:29 -0700 Subject: [PATCH 03/15] Regenerate snapshots --- .../BigQuery/test_join_to_scd_dimension__plan0.sql | 6 +++--- ...test_join_to_scd_dimension__plan0_optimized.sql | 2 +- ...test_multi_hop_through_scd_dimension__plan0.sql | 6 +++--- ..._hop_through_scd_dimension__plan0_optimized.sql | 4 ++-- .../test_multi_hop_to_scd_dimension__plan0.sql | 14 +++++++------- ...multi_hop_to_scd_dimension__plan0_optimized.sql | 10 +++++----- .../test_join_to_scd_dimension__plan0.sql | 8 ++++---- ...test_join_to_scd_dimension__plan0_optimized.sql | 4 ++-- ...test_multi_hop_through_scd_dimension__plan0.sql | 14 +++++++------- ..._hop_through_scd_dimension__plan0_optimized.sql | 10 +++++----- .../test_multi_hop_to_scd_dimension__plan0.sql | 14 +++++++------- ...multi_hop_to_scd_dimension__plan0_optimized.sql | 10 +++++----- .../Postgres/test_join_to_scd_dimension__plan0.sql | 14 +++++++------- ...test_join_to_scd_dimension__plan0_optimized.sql | 6 +++--- ...test_multi_hop_through_scd_dimension__plan0.sql | 6 +++--- ..._hop_through_scd_dimension__plan0_optimized.sql | 4 ++-- .../test_multi_hop_to_scd_dimension__plan0.sql | 14 +++++++------- ...multi_hop_to_scd_dimension__plan0_optimized.sql | 10 +++++----- .../Redshift/test_join_to_scd_dimension__plan0.sql | 14 +++++++------- ...test_join_to_scd_dimension__plan0_optimized.sql | 6 +++--- ...test_multi_hop_through_scd_dimension__plan0.sql | 14 +++++++------- ..._hop_through_scd_dimension__plan0_optimized.sql | 10 +++++----- .../test_multi_hop_to_scd_dimension__plan0.sql | 6 +++--- ...multi_hop_to_scd_dimension__plan0_optimized.sql | 4 ++-- .../test_join_to_scd_dimension__plan0.sql | 14 +++++++------- ...test_join_to_scd_dimension__plan0_optimized.sql | 6 +++--- ...test_multi_hop_through_scd_dimension__plan0.sql | 14 +++++++------- ..._hop_through_scd_dimension__plan0_optimized.sql | 10 +++++----- .../test_multi_hop_to_scd_dimension__plan0.sql | 14 +++++++------- ...multi_hop_to_scd_dimension__plan0_optimized.sql | 10 +++++----- 30 files changed, 139 insertions(+), 139 deletions(-) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql index bc49c849ed..00a9252e55 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql @@ -30,7 +30,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_4.window_start__day AS listing__window_start__day , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity @@ -243,7 +243,7 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_dayofyear + subq_3.window_start__day , subq_3.window_end__day , subq_3.listing , subq_3.capacity @@ -315,7 +315,7 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_dayofyear + subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( subq_2.metric_time__day < subq_4.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql index d9f3cf01a4..86a2010b35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,7 +32,7 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) + subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( subq_12.metric_time__day < listings_src_10017.active_to diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql index 024c911d5b..9a8ead4f06 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_7.window_start__day AS listing__window_start__day , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest @@ -233,7 +233,7 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_dayofyear + subq_6.window_start__day , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest @@ -471,7 +471,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_dayofyear + subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( subq_2.metric_time__day < subq_7.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 6fee75f492..e8abbb3f87 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,7 +23,7 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + listings_src_10017.active_from AS window_start__day , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest @@ -38,7 +38,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_dayofyear + subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( subq_13.metric_time__day < subq_18.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql index 2f8078af36..2f2cded306 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_day AS listing__lux_listing__window_start__extract_day - , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month + , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day + , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -236,8 +236,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_day - , subq_6.lux_listing__window_end__extract_month + subq_6.lux_listing__window_start__day + , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -450,12 +450,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_day + subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month + subq_2.metric_time__day < subq_7.lux_listing__window_end__day ) OR ( - subq_7.lux_listing__window_end__extract_month IS NULL + subq_7.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql index 2ab605916c..415ccb8d00 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + lux_listings_src_10019.valid_from AS lux_listing__window_start__day + , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_day + subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month + subq_13.metric_time__day < subq_18.lux_listing__window_end__day ) OR ( - subq_18.lux_listing__window_end__extract_month IS NULL + subq_18.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql index 613d0fde8e..0d0160478b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql @@ -31,7 +31,7 @@ FROM ( SELECT subq_2.metric_time__day AS metric_time__day , subq_4.window_start__day AS listing__window_start__day - , subq_4.window_end__extract_week AS listing__window_end__extract_week + , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -244,7 +244,7 @@ FROM ( -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT subq_3.window_start__day - , subq_3.window_end__extract_week + , subq_3.window_end__day , subq_3.listing , subq_3.capacity FROM ( @@ -318,9 +318,9 @@ FROM ( subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_week + subq_2.metric_time__day < subq_4.window_end__day ) OR ( - subq_4.window_end__extract_week IS NULL + subq_4.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql index f0af95c23f..86a2010b35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0_optimized.sql @@ -35,9 +35,9 @@ FROM ( subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < EXTRACT(WEEK FROM listings_src_10017.active_to) + subq_12.metric_time__day < listings_src_10017.active_to ) OR ( - EXTRACT(WEEK FROM listings_src_10017.active_to) IS NULL + listings_src_10017.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql index ff186bc953..8430dbca74 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_week AS listing__window_start__extract_week - , subq_7.window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_7.window_start__day AS listing__window_start__day + , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -233,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_week - , subq_6.window_end__extract_dayofyear + subq_6.window_start__day + , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -471,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_week + subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_dayofyear + subq_2.metric_time__day < subq_7.window_end__day ) OR ( - subq_7.window_end__extract_dayofyear IS NULL + subq_7.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 060e8301a1..feb5ed0fdc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DOY FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + listings_src_10017.active_from AS window_start__day + , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_week + subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_dayofyear + subq_13.metric_time__day < subq_18.window_end__day ) OR ( - subq_18.window_end__extract_dayofyear IS NULL + subq_18.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql index 7d569f8111..8d8a7b2fed 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_dayofweek AS listing__lux_listing__window_start__extract_dayofweek - , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month + , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day + , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -236,8 +236,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_dayofweek - , subq_6.lux_listing__window_end__extract_month + subq_6.lux_listing__window_start__day + , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -450,12 +450,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofweek + subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month + subq_2.metric_time__day < subq_7.lux_listing__window_end__day ) OR ( - subq_7.lux_listing__window_end__extract_month IS NULL + subq_7.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql index aca1260a66..f1b419a284 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + lux_listings_src_10019.valid_from AS lux_listing__window_start__day + , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofweek + subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month + subq_13.metric_time__day < subq_18.lux_listing__window_end__day ) OR ( - subq_18.lux_listing__window_end__extract_month IS NULL + subq_18.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql index 08dd31437a..5712e1d25c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_dayofyear AS listing__window_start__extract_dayofyear - , subq_4.window_end__extract_quarter AS listing__window_end__extract_quarter + , subq_4.window_start__day AS listing__window_start__day + , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -243,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_dayofyear - , subq_3.window_end__extract_quarter + subq_3.window_start__day + , subq_3.window_end__day , subq_3.listing , subq_3.capacity FROM ( @@ -315,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_dayofyear + subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_quarter + subq_2.metric_time__day < subq_4.window_end__day ) OR ( - subq_4.window_end__extract_quarter IS NULL + subq_4.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql index 297e00735f..86a2010b35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) + subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < EXTRACT(QUARTER FROM listings_src_10017.active_to) + subq_12.metric_time__day < listings_src_10017.active_to ) OR ( - EXTRACT(QUARTER FROM listings_src_10017.active_to) IS NULL + listings_src_10017.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql index 0bcca6489b..db50a9f2c8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_day AS listing__window_start__extract_day + , subq_7.window_start__day AS listing__window_start__day , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest @@ -233,7 +233,7 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_day + subq_6.window_start__day , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest @@ -471,7 +471,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_day + subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( subq_2.metric_time__day < subq_7.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql index fdc48352dd..feb5ed0fdc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,7 +23,7 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day + listings_src_10017.active_from AS window_start__day , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest @@ -38,7 +38,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_day + subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( subq_13.metric_time__day < subq_18.window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql index bc41ed72fa..adaf16cf58 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_dayofweek AS listing__lux_listing__window_start__extract_dayofweek - , subq_7.lux_listing__window_end__extract_month AS listing__lux_listing__window_end__extract_month + , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day + , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -236,8 +236,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_dayofweek - , subq_6.lux_listing__window_end__extract_month + subq_6.lux_listing__window_start__day + , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -450,12 +450,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofweek + subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_month + subq_2.metric_time__day < subq_7.lux_listing__window_end__day ) OR ( - subq_7.lux_listing__window_end__extract_month IS NULL + subq_7.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql index aca1260a66..f1b419a284 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + lux_listings_src_10019.valid_from AS lux_listing__window_start__day + , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofweek + subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_month + subq_13.metric_time__day < subq_18.lux_listing__window_end__day ) OR ( - subq_18.lux_listing__window_end__extract_month IS NULL + subq_18.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql index ff0c914625..5712e1d25c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_year AS listing__window_start__extract_year - , subq_4.window_end__extract_year AS listing__window_end__extract_year + , subq_4.window_start__day AS listing__window_start__day + , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -243,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_year - , subq_3.window_end__extract_year + subq_3.window_start__day + , subq_3.window_end__day , subq_3.listing , subq_3.capacity FROM ( @@ -315,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_year + subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_year + subq_2.metric_time__day < subq_4.window_end__day ) OR ( - subq_4.window_end__extract_year IS NULL + subq_4.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql index c37cd61528..86a2010b35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(YEAR FROM listings_src_10017.active_from) + subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < EXTRACT(YEAR FROM listings_src_10017.active_to) + subq_12.metric_time__day < listings_src_10017.active_to ) OR ( - EXTRACT(YEAR FROM listings_src_10017.active_to) IS NULL + listings_src_10017.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql index 6644918147..db50a9f2c8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_year AS listing__window_start__extract_year - , subq_7.window_end__extract_year AS listing__window_end__extract_year + , subq_7.window_start__day AS listing__window_start__day + , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -233,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_year - , subq_6.window_end__extract_year + subq_6.window_start__day + , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -471,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_year + subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_year + subq_2.metric_time__day < subq_7.window_end__day ) OR ( - subq_7.window_end__extract_year IS NULL + subq_7.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 8fcb6ec7af..feb5ed0fdc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year + listings_src_10017.active_from AS window_start__day + , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_year + subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_year + subq_13.metric_time__day < subq_18.window_end__day ) OR ( - subq_18.window_end__extract_year IS NULL + subq_18.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql index 9397ea8d7a..adaf16cf58 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,7 +20,7 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_dayofweek AS listing__lux_listing__window_start__extract_dayofweek + , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux @@ -236,7 +236,7 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_dayofweek + subq_6.lux_listing__window_start__day , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux @@ -450,7 +450,7 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofweek + subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( subq_2.metric_time__day < subq_7.lux_listing__window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql index 926cc6d3ad..f1b419a284 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,7 +26,7 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek + lux_listings_src_10019.valid_from AS lux_listing__window_start__day , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux @@ -41,7 +41,7 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofweek + subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( subq_13.metric_time__day < subq_18.lux_listing__window_end__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql index dbe82316e7..5712e1d25c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql @@ -30,8 +30,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_4.window_start__extract_month AS listing__window_start__extract_month - , subq_4.window_end__extract_month AS listing__window_end__extract_month + , subq_4.window_start__day AS listing__window_start__day + , subq_4.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_4.capacity AS listing__capacity , subq_2.bookings AS bookings @@ -243,8 +243,8 @@ FROM ( -- Pass Only Elements: -- ['capacity', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_3.window_start__extract_month - , subq_3.window_end__extract_month + subq_3.window_start__day + , subq_3.window_end__day , subq_3.listing , subq_3.capacity FROM ( @@ -315,12 +315,12 @@ FROM ( subq_2.listing = subq_4.listing ) AND ( ( - subq_2.metric_time__day >= subq_4.window_start__extract_month + subq_2.metric_time__day >= subq_4.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_4.window_end__extract_month + subq_2.metric_time__day < subq_4.window_end__day ) OR ( - subq_4.window_end__extract_month IS NULL + subq_4.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql index 24f243f464..86a2010b35 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0_optimized.sql @@ -32,12 +32,12 @@ FROM ( subq_12.listing = listings_src_10017.listing_id ) AND ( ( - subq_12.metric_time__day >= EXTRACT(MONTH FROM listings_src_10017.active_from) + subq_12.metric_time__day >= listings_src_10017.active_from ) AND ( ( - subq_12.metric_time__day < EXTRACT(MONTH FROM listings_src_10017.active_to) + subq_12.metric_time__day < listings_src_10017.active_to ) OR ( - EXTRACT(MONTH FROM listings_src_10017.active_to) IS NULL + listings_src_10017.active_to IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql index a4dc109e27..db50a9f2c8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.window_start__extract_month AS listing__window_start__extract_month - , subq_7.window_end__extract_month AS listing__window_end__extract_month + , subq_7.window_start__day AS listing__window_start__day + , subq_7.window_end__day AS listing__window_end__day , subq_2.listing AS listing , subq_7.user__home_state_latest AS listing__user__home_state_latest , subq_2.bookings AS bookings @@ -233,8 +233,8 @@ FROM ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - subq_6.window_start__extract_month - , subq_6.window_end__extract_month + subq_6.window_start__day + , subq_6.window_end__day , subq_6.listing , subq_6.user__home_state_latest FROM ( @@ -471,12 +471,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.window_start__extract_month + subq_2.metric_time__day >= subq_7.window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.window_end__extract_month + subq_2.metric_time__day < subq_7.window_end__day ) OR ( - subq_7.window_end__extract_month IS NULL + subq_7.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql index 004fe3196a..feb5ed0fdc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0_optimized.sql @@ -23,8 +23,8 @@ LEFT OUTER JOIN ( -- Pass Only Elements: -- ['user__home_state_latest', 'window_start__day', 'window_end__day', 'listing'] SELECT - EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month + listings_src_10017.active_from AS window_start__day + , listings_src_10017.active_to AS window_end__day , listings_src_10017.listing_id AS listing , users_latest_src_10021.home_state_latest AS user__home_state_latest FROM ***************************.dim_listings listings_src_10017 @@ -38,12 +38,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.window_start__extract_month + subq_13.metric_time__day >= subq_18.window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.window_end__extract_month + subq_13.metric_time__day < subq_18.window_end__day ) OR ( - subq_18.window_end__extract_month IS NULL + subq_18.window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql index a3b53ef6af..adaf16cf58 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql @@ -20,8 +20,8 @@ FROM ( -- Join Standard Outputs SELECT subq_2.metric_time__day AS metric_time__day - , subq_7.lux_listing__window_start__extract_dayofyear AS listing__lux_listing__window_start__extract_dayofyear - , subq_7.lux_listing__window_end__extract_quarter AS listing__lux_listing__window_end__extract_quarter + , subq_7.lux_listing__window_start__day AS listing__lux_listing__window_start__day + , subq_7.lux_listing__window_end__day AS listing__lux_listing__window_end__day , subq_2.listing AS listing , subq_7.lux_listing__is_confirmed_lux AS listing__lux_listing__is_confirmed_lux , subq_2.bookings AS bookings @@ -236,8 +236,8 @@ FROM ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - subq_6.lux_listing__window_start__extract_dayofyear - , subq_6.lux_listing__window_end__extract_quarter + subq_6.lux_listing__window_start__day + , subq_6.lux_listing__window_end__day , subq_6.listing , subq_6.lux_listing__is_confirmed_lux FROM ( @@ -450,12 +450,12 @@ FROM ( subq_2.listing = subq_7.listing ) AND ( ( - subq_2.metric_time__day >= subq_7.lux_listing__window_start__extract_dayofyear + subq_2.metric_time__day >= subq_7.lux_listing__window_start__day ) AND ( ( - subq_2.metric_time__day < subq_7.lux_listing__window_end__extract_quarter + subq_2.metric_time__day < subq_7.lux_listing__window_end__day ) OR ( - subq_7.lux_listing__window_end__extract_quarter IS NULL + subq_7.lux_listing__window_end__day IS NULL ) ) ) diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql index 8dc33d857c..f1b419a284 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0_optimized.sql @@ -26,8 +26,8 @@ LEFT OUTER JOIN ( -- 'lux_listing__window_end__day', -- 'listing'] SELECT - EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + lux_listings_src_10019.valid_from AS lux_listing__window_start__day + , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , lux_listing_mapping_src_10018.listing_id AS listing , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux FROM ***************************.dim_lux_listing_id_mapping lux_listing_mapping_src_10018 @@ -41,12 +41,12 @@ ON subq_13.listing = subq_18.listing ) AND ( ( - subq_13.metric_time__day >= subq_18.lux_listing__window_start__extract_dayofyear + subq_13.metric_time__day >= subq_18.lux_listing__window_start__day ) AND ( ( - subq_13.metric_time__day < subq_18.lux_listing__window_end__extract_quarter + subq_13.metric_time__day < subq_18.lux_listing__window_end__day ) OR ( - subq_18.lux_listing__window_end__extract_quarter IS NULL + subq_18.lux_listing__window_end__day IS NULL ) ) ) From 0f3cf0b5dcdcc2eb2ac75517fee09855f0ea7fc9 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 19:07:40 -0700 Subject: [PATCH 04/15] Handle time offset with date_part --- metricflow/plan_conversion/dataflow_to_sql.py | 46 +++++++++++-------- metricflow/query/query_parser.py | 1 + .../integration/test_cases/itest_metrics.yaml | 30 ++++++++++-- .../test/integration/test_configured_cases.py | 19 ++++++++ 4 files changed, 73 insertions(+), 23 deletions(-) diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 6dc0db4c23..84b2e0d261 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -89,6 +89,7 @@ SqlComparisonExpression, SqlDateTruncExpression, SqlExpressionNode, + SqlExtractExpression, SqlFunctionExpression, SqlLogicalExpression, SqlLogicalOperator, @@ -292,7 +293,8 @@ def visit_join_over_time_range_node(self, node: JoinOverTimeRangeNode[SqlDataSet metric_time_dimension_spec ).column_name - # assemble dataset with metric_time_dimension to join + # Assemble time_spine dataset with metric_time_dimension to join. + # Granularity of time_spine column should match granularity of metric_time column from parent dataset. assert metric_time_dimension_instance time_spine_data_set = self._make_time_spine_data_set( metric_time_dimension_instance=metric_time_dimension_instance, @@ -1354,11 +1356,11 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode[SourceDataSetT len(time_spine_dataset.instance_set.time_dimension_instances) == 1 and len(time_spine_dataset.sql_select_node.select_columns) == 1 ), "Time spine dataset not configured properly. Expected exactly one column." - original_time_dim_instance = time_spine_dataset.instance_set.time_dimension_instances[0] + time_dim_instance = time_spine_dataset.instance_set.time_dimension_instances[0] time_spine_column_select_expr: Union[ SqlColumnReferenceExpression, SqlDateTruncExpression ] = SqlColumnReferenceExpression( - SqlColumnReference(table_alias=time_spine_alias, column_name=original_time_dim_instance.spec.qualified_name) + SqlColumnReference(table_alias=time_spine_alias, column_name=time_dim_instance.spec.qualified_name) ) # Add requested granularities (skip for default granularity) and date_parts. @@ -1366,28 +1368,15 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode[SourceDataSetT metric_time_dimension_instances = [] where: Optional[SqlExpressionNode] = None for metric_time_dimension_spec in node.metric_time_dimension_specs: + # Apply granularity to SQL. if metric_time_dimension_spec.time_granularity == self._time_spine_source.time_column_granularity: - select_expr = time_spine_column_select_expr - time_dim_instance = original_time_dim_instance - column_alias = original_time_dim_instance.associated_column.column_name + select_expr: SqlExpressionNode = time_spine_column_select_expr else: select_expr = SqlDateTruncExpression( time_granularity=metric_time_dimension_spec.time_granularity, arg=time_spine_column_select_expr ) - new_time_dim_spec = TimeDimensionSpec( - element_name=original_time_dim_instance.spec.element_name, - entity_links=original_time_dim_instance.spec.entity_links, - time_granularity=metric_time_dimension_spec.time_granularity, - date_part=metric_time_dimension_spec.date_part, - aggregation_state=original_time_dim_instance.spec.aggregation_state, - ) - time_dim_instance = TimeDimensionInstance( - defined_from=original_time_dim_instance.defined_from, - associated_columns=(self._column_association_resolver.resolve_spec(new_time_dim_spec),), - spec=new_time_dim_spec, - ) - column_alias = time_dim_instance.associated_column.column_name if node.offset_to_grain: + # TODO: allow offset_to_grain w/ granularity & datepart? what's the expected behavior? # Filter down to one row per granularity period new_filter = SqlComparisonExpression( left_expr=select_expr, comparison=SqlComparison.EQUALS, right_expr=time_spine_column_select_expr @@ -1396,8 +1385,25 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode[SourceDataSetT where = new_filter else: where = SqlLogicalExpression(operator=SqlLogicalOperator.OR, args=(where, new_filter)) + # Apply date_part to SQL. + if metric_time_dimension_spec.date_part: + select_expr = SqlExtractExpression(date_part=metric_time_dimension_spec.date_part, arg=select_expr) + time_dim_spec = TimeDimensionSpec( + element_name=time_dim_instance.spec.element_name, + entity_links=time_dim_instance.spec.entity_links, + time_granularity=metric_time_dimension_spec.time_granularity, + date_part=metric_time_dimension_spec.date_part, + aggregation_state=time_dim_instance.spec.aggregation_state, + ) + time_dim_instance = TimeDimensionInstance( + defined_from=time_dim_instance.defined_from, + associated_columns=(self._column_association_resolver.resolve_spec(time_dim_spec),), + spec=time_dim_spec, + ) metric_time_dimension_instances.append(time_dim_instance) - metric_time_select_columns.append(SqlSelectColumn(expr=select_expr, column_alias=column_alias)) + metric_time_select_columns.append( + SqlSelectColumn(expr=select_expr, column_alias=time_dim_instance.associated_column.column_name) + ) metric_time_instance_set = InstanceSet(time_dimension_instances=tuple(metric_time_dimension_instances)) return SqlDataSet( diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 6f437117ac..956f3933fc 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -797,6 +797,7 @@ def _parse_order_by( element_name=parsed_name.element_name, entity_links=entity_links, time_granularity=parsed_name.time_granularity, + date_part=parsed_name.date_part, ), descending=descending, ) diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index ced9b011a1..f08254aaa1 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1053,7 +1053,31 @@ integration_test: check_query: | SELECT SUM(1) AS bookings - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek + , {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dayofweek FROM {{ source_schema }}.fct_bookings - GROUP BY EXTRACT(DAYOFWEEK FROM ds); -# TODO: test with cumulative metric, offset metric, others? + GROUP BY {{ render_extract("ds", DatePart.DAYOFWEEK) }}; +--- +integration_test: + name: derived_metric_offset_window_and_date_part + description: Tests a derived metric offset query with window and date_part + model: SIMPLE_MODEL + metrics: ["bookings_5_day_lag"] + group_bys: ["metric_time__extract_month"] + check_query: | + SELECT + {{ render_extract("a.ds", DatePart.MONTH) }} AS metric_time__extract_month + , SUM(b.bookings_5_day_lag) AS bookings_5_day_lag + FROM {{ mf_time_spine_source }} a + INNER JOIN ( + SELECT + ds AS metric_time__day + , 1 AS bookings_5_day_lag + FROM {{ source_schema }}.fct_bookings + ) b + ON {{ render_date_sub("a", "ds", 5, TimeGranularity.DAY) }} = b.metric_time__day + GROUP BY metric_time__extract_month + +# TODO: +# test each date part syntax with each engine +# dataflow plan tests? +# dataflow to sql tests? diff --git a/metricflow/test/integration/test_configured_cases.py b/metricflow/test/integration/test_configured_cases.py index 12b6aac0f3..cde625fde7 100644 --- a/metricflow/test/integration/test_configured_cases.py +++ b/metricflow/test/integration/test_configured_cases.py @@ -23,6 +23,7 @@ SqlColumnReference, SqlColumnReferenceExpression, SqlDateTruncExpression, + SqlExtractExpression, SqlPercentileExpression, SqlPercentileExpressionArgument, SqlPercentileFunctionType, @@ -39,6 +40,7 @@ from metricflow.test.time.configurable_time_source import ( ConfigurableTimeSource, ) +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -100,6 +102,19 @@ def render_date_trunc(self, expr: str, granularity: TimeGranularity) -> str: ) return self._sql_client.sql_query_plan_renderer.expr_renderer.render_sql_expr(renderable_expr).sql + def render_extract(self, expr: str, date_part: DatePart) -> str: + """Return the EXTRACT call that can be used for converting the given expr to the date_part.""" + renderable_expr = SqlExtractExpression( + date_part=date_part, + arg=SqlCastToTimestampExpression( + arg=SqlStringExpression( + sql_expr=expr, + requires_parenthesis=False, + ) + ), + ) + return self._sql_client.sql_query_plan_renderer.expr_renderer.render_sql_expr(renderable_expr).sql + def render_percentile_expr( self, expr: str, percentile: float, use_discrete_percentile: bool, use_approximate_percentile: bool ) -> str: @@ -252,8 +267,10 @@ def test_case( source_schema=mf_test_session_state.mf_source_schema, render_time_constraint=check_query_helpers.render_time_constraint, TimeGranularity=TimeGranularity, + DatePart=DatePart, render_date_sub=check_query_helpers.render_date_sub, render_date_trunc=check_query_helpers.render_date_trunc, + render_extract=check_query_helpers.render_extract, render_percentile_expr=check_query_helpers.render_percentile_expr, mf_time_spine_source=semantic_manifest_lookup.time_spine_source.spine_table.sql, double_data_type_name=check_query_helpers.double_data_type_name, @@ -277,8 +294,10 @@ def test_case( source_schema=mf_test_session_state.mf_source_schema, render_time_constraint=check_query_helpers.render_time_constraint, TimeGranularity=TimeGranularity, + DatePart=DatePart, render_date_sub=check_query_helpers.render_date_sub, render_date_trunc=check_query_helpers.render_date_trunc, + render_extract=check_query_helpers.render_extract, render_percentile_expr=check_query_helpers.render_percentile_expr, mf_time_spine_source=semantic_manifest_lookup.time_spine_source.spine_table.sql, double_data_type_name=check_query_helpers.double_data_type_name, From cb71648ac4982ade297dd5bcc6cdf9f39f41445e Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 19:09:35 -0700 Subject: [PATCH 05/15] Changelog --- .changes/unreleased/Features-20230911-190924.yaml | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changes/unreleased/Features-20230911-190924.yaml diff --git a/.changes/unreleased/Features-20230911-190924.yaml b/.changes/unreleased/Features-20230911-190924.yaml new file mode 100644 index 0000000000..8370049390 --- /dev/null +++ b/.changes/unreleased/Features-20230911-190924.yaml @@ -0,0 +1,6 @@ +kind: Features +body: DatePart aggregation for time dimensions +time: 2023-09-11T19:09:24.960342-07:00 +custom: + Author: courtneyholcomb + Issue: "770" From 16adef79164d595772d4059cd504b54a272fbb11 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 20:18:12 -0700 Subject: [PATCH 06/15] Tests for all DateParts --- .../integration/test_cases/itest_metrics.yaml | 31 ++++++++++++++----- metricflow/test/sql/test_sql_expr_render.py | 9 ++++++ 2 files changed, 33 insertions(+), 7 deletions(-) diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index f08254aaa1..b2cd3a914a 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1049,13 +1049,35 @@ integration_test: description: Test query using date_part model: SIMPLE_MODEL metrics: ["bookings"] - group_bys: ["metric_time__extract_dayofweek"] + group_bys: ["metric_time__extract_year"] check_query: | SELECT SUM(1) AS bookings + , {{ render_extract("ds", DatePart.YEAR) }} AS metric_time__extract_year + FROM {{ source_schema }}.fct_bookings + GROUP BY {{ render_extract("ds", DatePart.YEAR) }}; +--- +integration_test: + name: simple_query_with_multiple_date_parts + description: Test query using multiple date_parts + model: SIMPLE_MODEL + metrics: ["bookings"] + group_bys: ["metric_time__extract_quarter", "metric_time__extract_dayofweek", "metric_time__extract_dayofyear", "metric_time__extract_day", "metric_time__extract_week"] + check_query: | + SELECT + SUM(1) AS bookings + , {{ render_extract("ds", DatePart.QUARTER) }} AS metric_time__extract_quarter , {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dayofweek + , {{ render_extract("ds", DatePart.DAYOFYEAR) }} AS metric_time__extract_dayofyear + , {{ render_extract("ds", DatePart.DAY) }} AS metric_time__extract_day + , {{ render_extract("ds", DatePart.WEEK) }} AS metric_time__extract_week FROM {{ source_schema }}.fct_bookings - GROUP BY {{ render_extract("ds", DatePart.DAYOFWEEK) }}; + GROUP BY + {{ render_extract("ds", DatePart.QUARTER) }} + , {{ render_extract("ds", DatePart.DAYOFWEEK) }} + , {{ render_extract("ds", DatePart.DAYOFYEAR) }} + , {{ render_extract("ds", DatePart.DAY) }} + , {{ render_extract("ds", DatePart.WEEK) }}; --- integration_test: name: derived_metric_offset_window_and_date_part @@ -1076,8 +1098,3 @@ integration_test: ) b ON {{ render_date_sub("a", "ds", 5, TimeGranularity.DAY) }} = b.metric_time__day GROUP BY metric_time__extract_month - -# TODO: -# test each date part syntax with each engine -# dataflow plan tests? -# dataflow to sql tests? diff --git a/metricflow/test/sql/test_sql_expr_render.py b/metricflow/test/sql/test_sql_expr_render.py index c123843ae2..035dca2f2e 100644 --- a/metricflow/test/sql/test_sql_expr_render.py +++ b/metricflow/test/sql/test_sql_expr_render.py @@ -17,6 +17,7 @@ SqlComparison, SqlComparisonExpression, SqlDateTruncExpression, + SqlExtractExpression, SqlFunction, SqlIsNullExpression, SqlLogicalExpression, @@ -29,6 +30,7 @@ SqlWindowFunctionExpression, SqlWindowOrderByArgument, ) +from metricflow.time.date_part import DatePart logger = logging.getLogger(__name__) @@ -193,6 +195,13 @@ def test_date_trunc_expr(default_expr_renderer: DefaultSqlExpressionRenderer) -> assert actual == "DATE_TRUNC('month', ds)" +def test_extract_expr(default_expr_renderer: DefaultSqlExpressionRenderer) -> None: # noqa: D + actual = default_expr_renderer.render_sql_expr( + SqlExtractExpression(date_part=DatePart.DAYOFYEAR, arg=SqlStringExpression("ds")) + ).sql + assert actual == "EXTRACT(DAYOFYEAR FROM ds)" + + def test_ratio_computation_expr(default_expr_renderer: DefaultSqlExpressionRenderer) -> None: # noqa: D actual = default_expr_renderer.render_sql_expr( SqlRatioComputationExpression( From b1468953c40f973fa458d4e4f752f8fb607e15da Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 20:32:06 -0700 Subject: [PATCH 07/15] Rename to dow and doy --- .../integration/test_cases/itest_metrics.yaml | 6 +- ...st_convert_query_semantic_model__plan0.sql | 8 +- ...le_semantic_model_with_measures__plan0.sql | 16 +- ...semantic_model_without_measures__plan0.sql | 8 +- .../test_multihop_join_plan__dfp_0.xml | 32 +- .../test_common_semantic_model__plan0.sql | 104 ++-- .../test_compute_metrics_node__plan0.sql | 40 +- ...o_from_multiple_semantic_models__plan0.sql | 160 +++--- ...atio_from_single_semantic_model__plan0.sql | 40 +- ...ompute_metrics_node_simple_expr__plan0.sql | 40 +- .../test_constrain_time_range_node__plan0.sql | 24 +- .../DuckDB/test_cumulative_metric__plan0.sql | 20 +- ...cumulative_metric_grain_to_date__plan0.sql | 20 +- .../test_cumulative_metric_no_ds__plan0.sql | 20 +- ...est_cumulative_metric_no_window__plan0.sql | 20 +- ..._no_window_with_time_constraint__plan0.sql | 32 +- ...ive_metric_with_time_constraint__plan0.sql | 32 +- .../DuckDB/test_derived_metric__plan0.sql | 104 ++-- ...ved_metric_with_offset_to_grain__plan0.sql | 128 ++--- ...offset_to_grain_and_granularity__plan0.sql | 128 ++--- ...rived_metric_with_offset_window__plan0.sql | 128 ++--- ...h_offset_window_and_granularity__plan0.sql | 128 ++--- ...fset_window_and_offset_to_grain__plan0.sql | 152 ++--- ...offset_to_grain_and_granularity__plan0.sql | 152 ++--- ...erived_offset_cumulative_metric__plan0.sql | 104 ++-- ...et_metric_with_one_input_metric__plan0.sql | 76 +-- .../DuckDB/test_distinct_values__plan0.sql | 88 +-- .../DuckDB/test_filter_node__plan0.sql | 24 +- ...lter_with_where_constraint_node__plan0.sql | 24 +- ...th_where_constraint_on_join_dim__plan0.sql | 88 +-- .../test_join_to_scd_dimension__plan0.sql | 68 +-- ...spine_node_with_offset_to_grain__plan0.sql | 52 +- ...e_spine_node_with_offset_window__plan0.sql | 52 +- ..._time_spine_node_without_offset__plan0.sql | 52 +- .../DuckDB/test_limit_rows__plan0.sql | 52 +- ...al_dimension_using_local_entity__plan0.sql | 36 +- .../test_measure_aggregation_node__plan0.sql | 24 +- .../DuckDB/test_measure_constraint__plan0.sql | 228 ++++---- ..._constraint_with_reused_measure__plan0.sql | 104 ++-- ...aint_with_single_expr_and_alias__plan0.sql | 52 +- ..._multiple_sources_no_dimensions__plan0.sql | 88 +-- ...multi_hop_through_scd_dimension__plan0.sql | 104 ++-- ...test_multi_hop_to_scd_dimension__plan0.sql | 92 +-- .../DuckDB/test_multi_join_node__plan0.sql | 56 +- .../DuckDB/test_multihop_node__plan0.sql | 72 +-- ..._multiple_metrics_no_dimensions__plan0.sql | 136 ++--- .../test_nested_derived_metric__plan0.sql | 208 +++---- .../DuckDB/test_order_by_node__plan0.sql | 24 +- .../DuckDB/test_partitioned_join__plan0.sql | 60 +- .../test_semi_additive_join_node__plan0.sql | 24 +- ...mi_additive_join_node__plan0_optimized.sql | 16 +- ...dditive_join_node_with_grouping__plan0.sql | 24 +- ...in_node_with_grouping__plan0_optimized.sql | 16 +- ...join_node_with_queried_group_by__plan0.sql | 24 +- ...with_queried_group_by__plan0_optimized.sql | 16 +- .../DuckDB/test_single_join_node__plan0.sql | 40 +- .../DuckDB/test_source_node__plan0.sql | 24 +- .../test_source_node__plan0_optimized.sql | 24 +- .../test_common_semantic_model__plan0.xml | 248 ++++---- .../test_compute_metrics_node__plan0.xml | 124 ++-- ...o_from_multiple_semantic_models__plan0.xml | 364 ++++++------ ...atio_from_single_semantic_model__plan0.xml | 124 ++-- ...ompute_metrics_node_simple_expr__plan0.xml | 124 ++-- .../test_constrain_time_range_node__plan0.xml | 72 +-- .../test_cumulative_metric__plan0.xml | 32 +- ...cumulative_metric_grain_to_date__plan0.xml | 32 +- .../test_cumulative_metric_no_ds__plan0.xml | 32 +- ...est_cumulative_metric_no_window__plan0.xml | 32 +- ..._no_window_with_time_constraint__plan0.xml | 44 +- ...ive_metric_with_time_constraint__plan0.xml | 44 +- .../test_derived_metric__plan0.xml | 248 ++++---- ...ved_metric_with_offset_to_grain__plan0.xml | 296 +++++----- ...offset_to_grain_and_granularity__plan0.xml | 296 +++++----- ...rived_metric_with_offset_window__plan0.xml | 296 +++++----- ...h_offset_window_and_granularity__plan0.xml | 296 +++++----- ...fset_window_and_offset_to_grain__plan0.xml | 344 +++++------ ...offset_to_grain_and_granularity__plan0.xml | 344 +++++------ ...erived_offset_cumulative_metric__plan0.xml | 224 ++++---- ...et_metric_with_one_input_metric__plan0.xml | 172 +++--- .../test_distinct_values__plan0.xml | 208 +++---- .../SqlQueryPlan/test_filter_node__plan0.xml | 72 +-- ...lter_with_where_constraint_node__plan0.xml | 72 +-- ...th_where_constraint_on_join_dim__plan0.xml | 208 +++---- .../test_join_to_scd_dimension__plan0.xml | 188 +++--- ...spine_node_with_offset_to_grain__plan0.xml | 124 ++-- ...e_spine_node_with_offset_window__plan0.xml | 124 ++-- ..._time_spine_node_without_offset__plan0.xml | 124 ++-- .../SqlQueryPlan/test_limit_rows__plan0.xml | 124 ++-- ...al_dimension_using_local_entity__plan0.xml | 84 +-- .../test_measure_aggregation_node__plan0.xml | 72 +-- .../test_measure_constraint__plan0.xml | 540 +++++++++--------- ..._constraint_with_reused_measure__plan0.xml | 248 ++++---- ...aint_with_single_expr_and_alias__plan0.xml | 124 ++-- ..._multiple_sources_no_dimensions__plan0.xml | 208 +++---- ...multi_hop_through_scd_dimension__plan0.xml | 248 ++++---- ...test_multi_hop_to_scd_dimension__plan0.xml | 260 ++++----- .../test_multi_join_node__plan0.xml | 176 +++--- .../test_multihop_node__plan0.xml | 204 +++---- ..._multiple_metrics_no_dimensions__plan0.xml | 280 ++++----- .../test_nested_derived_metric__plan0.xml | 496 ++++++++-------- .../test_order_by_node__plan0.xml | 72 +-- .../test_partitioned_join__plan0.xml | 168 +++--- .../test_semi_additive_join_node__plan0.xml | 48 +- ...dditive_join_node_with_grouping__plan0.xml | 48 +- ...join_node_with_queried_group_by__plan0.xml | 48 +- .../test_single_join_node__plan0.xml | 124 ++-- .../SqlQueryPlan/test_source_node__plan0.xml | 72 +-- ...orm_node_using_non_primary_time__plan0.sql | 52 +- ...sing_non_primary_time__plan0_optimized.sql | 28 +- ...ansform_node_using_primary_time__plan0.sql | 52 +- ...de_using_primary_time__plan0_optimized.sql | 28 +- ...uery_with_metric_time_dimension__plan0.sql | 104 ++-- ...orm_node_using_non_primary_time__plan0.xml | 124 ++-- ...ansform_node_using_primary_time__plan0.xml | 124 ++-- ...uery_with_metric_time_dimension__plan0.xml | 248 ++++---- metricflow/time/date_part.py | 4 +- 116 files changed, 6515 insertions(+), 6515 deletions(-) diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index b2cd3a914a..aa184a67e1 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1062,13 +1062,13 @@ integration_test: description: Test query using multiple date_parts model: SIMPLE_MODEL metrics: ["bookings"] - group_bys: ["metric_time__extract_quarter", "metric_time__extract_dayofweek", "metric_time__extract_dayofyear", "metric_time__extract_day", "metric_time__extract_week"] + group_bys: ["metric_time__extract_quarter", "metric_time__extract_dow", "metric_time__extract_doy", "metric_time__extract_day", "metric_time__extract_week"] check_query: | SELECT SUM(1) AS bookings , {{ render_extract("ds", DatePart.QUARTER) }} AS metric_time__extract_quarter - , {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dayofweek - , {{ render_extract("ds", DatePart.DAYOFYEAR) }} AS metric_time__extract_dayofyear + , {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dow + , {{ render_extract("ds", DatePart.DAYOFYEAR) }} AS metric_time__extract_doy , {{ render_extract("ds", DatePart.DAY) }} AS metric_time__extract_day , {{ render_extract("ds", DatePart.WEEK) }} AS metric_time__extract_week FROM {{ source_schema }}.fct_bookings diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql index 390e922160..db7d8060c4 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql @@ -11,8 +11,8 @@ SELECT , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -23,8 +23,8 @@ SELECT , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql index 4a4b1f53f4..dd7ccdf1b3 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql @@ -11,8 +11,8 @@ SELECT , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month @@ -23,8 +23,8 @@ SELECT , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week @@ -36,8 +36,8 @@ SELECT , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month @@ -48,8 +48,8 @@ SELECT , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql index e3f2a1d31a..c62de83dc6 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql @@ -10,8 +10,8 @@ SELECT , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week @@ -23,8 +23,8 @@ SELECT , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml index e29686410d..289229a67a 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml @@ -253,20 +253,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -342,14 +342,14 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql index d2a3c6afd9..618f5f9d28 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,8 +155,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -167,8 +167,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -179,8 +179,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -192,8 +192,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -204,8 +204,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -216,8 +216,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -384,8 +384,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -396,8 +396,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -408,8 +408,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -421,8 +421,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -433,8 +433,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -445,8 +445,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql index c80b16baf0..70db1edf09 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql @@ -49,8 +49,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -73,8 +73,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -86,8 +86,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -143,8 +143,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -155,8 +155,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -170,8 +170,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -182,8 +182,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index c45302afaf..350c29d01e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -56,8 +56,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -68,8 +68,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -80,8 +80,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -116,8 +116,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -128,8 +128,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -179,8 +179,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -191,8 +191,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -203,8 +203,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -216,8 +216,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -228,8 +228,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -240,8 +240,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -271,8 +271,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -283,8 +283,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -295,8 +295,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -307,8 +307,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -319,8 +319,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -349,8 +349,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -361,8 +361,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -376,8 +376,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -388,8 +388,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -455,8 +455,8 @@ FROM ( , subq_10.ds__extract_month , subq_10.ds__extract_week , subq_10.ds__extract_day - , subq_10.ds__extract_dayofweek - , subq_10.ds__extract_dayofyear + , subq_10.ds__extract_dow + , subq_10.ds__extract_doy , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month @@ -467,8 +467,8 @@ FROM ( , subq_10.ds_partitioned__extract_month , subq_10.ds_partitioned__extract_week , subq_10.ds_partitioned__extract_day - , subq_10.ds_partitioned__extract_dayofweek - , subq_10.ds_partitioned__extract_dayofyear + , subq_10.ds_partitioned__extract_dow + , subq_10.ds_partitioned__extract_doy , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month @@ -479,8 +479,8 @@ FROM ( , subq_10.view__ds__extract_month , subq_10.view__ds__extract_week , subq_10.view__ds__extract_day - , subq_10.view__ds__extract_dayofweek - , subq_10.view__ds__extract_dayofyear + , subq_10.view__ds__extract_dow + , subq_10.view__ds__extract_doy , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month @@ -491,8 +491,8 @@ FROM ( , subq_10.view__ds_partitioned__extract_month , subq_10.view__ds_partitioned__extract_week , subq_10.view__ds_partitioned__extract_day - , subq_10.view__ds_partitioned__extract_dayofweek - , subq_10.view__ds_partitioned__extract_dayofyear + , subq_10.view__ds_partitioned__extract_dow + , subq_10.view__ds_partitioned__extract_doy , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -503,8 +503,8 @@ FROM ( , subq_10.ds__extract_month AS metric_time__extract_month , subq_10.ds__extract_week AS metric_time__extract_week , subq_10.ds__extract_day AS metric_time__extract_day - , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_10.ds__extract_dow AS metric_time__extract_dow + , subq_10.ds__extract_doy AS metric_time__extract_doy , subq_10.listing , subq_10.user , subq_10.view__listing @@ -524,8 +524,8 @@ FROM ( , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month @@ -536,8 +536,8 @@ FROM ( , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month @@ -548,8 +548,8 @@ FROM ( , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month @@ -560,8 +560,8 @@ FROM ( , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -589,8 +589,8 @@ FROM ( , subq_13.ds__extract_month , subq_13.ds__extract_week , subq_13.ds__extract_day - , subq_13.ds__extract_dayofweek - , subq_13.ds__extract_dayofyear + , subq_13.ds__extract_dow + , subq_13.ds__extract_doy , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month @@ -601,8 +601,8 @@ FROM ( , subq_13.created_at__extract_month , subq_13.created_at__extract_week , subq_13.created_at__extract_day - , subq_13.created_at__extract_dayofweek - , subq_13.created_at__extract_dayofyear + , subq_13.created_at__extract_dow + , subq_13.created_at__extract_doy , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month @@ -613,8 +613,8 @@ FROM ( , subq_13.listing__ds__extract_month , subq_13.listing__ds__extract_week , subq_13.listing__ds__extract_day - , subq_13.listing__ds__extract_dayofweek - , subq_13.listing__ds__extract_dayofyear + , subq_13.listing__ds__extract_dow + , subq_13.listing__ds__extract_doy , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month @@ -625,8 +625,8 @@ FROM ( , subq_13.listing__created_at__extract_month , subq_13.listing__created_at__extract_week , subq_13.listing__created_at__extract_day - , subq_13.listing__created_at__extract_dayofweek - , subq_13.listing__created_at__extract_dayofyear + , subq_13.listing__created_at__extract_dow + , subq_13.listing__created_at__extract_doy , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -637,8 +637,8 @@ FROM ( , subq_13.ds__extract_month AS metric_time__extract_month , subq_13.ds__extract_week AS metric_time__extract_week , subq_13.ds__extract_day AS metric_time__extract_day - , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_13.ds__extract_dow AS metric_time__extract_dow + , subq_13.ds__extract_doy AS metric_time__extract_doy , subq_13.listing , subq_13.user , subq_13.listing__user @@ -667,8 +667,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -679,8 +679,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -694,8 +694,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -706,8 +706,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index a56183e745..6cae314057 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -52,8 +52,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -64,8 +64,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -76,8 +76,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -89,8 +89,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -146,8 +146,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -158,8 +158,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -173,8 +173,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -185,8 +185,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql index b6f01861d7..26ccf221dd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql @@ -49,8 +49,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -73,8 +73,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -86,8 +86,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -143,8 +143,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -155,8 +155,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -170,8 +170,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -182,8 +182,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql index d480357663..3de0908e02 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql @@ -43,8 +43,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -55,8 +55,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -67,8 +67,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -80,8 +80,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql index ad08f90e35..ac35263413 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -69,8 +69,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -81,8 +81,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql index 8c2ab1a915..abf31492df 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -69,8 +69,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -81,8 +81,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql index 8d5b07c69a..20b5cb5156 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql @@ -23,8 +23,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -35,8 +35,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -66,8 +66,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -78,8 +78,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql index d98f0f554a..aee104bfff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -69,8 +69,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -81,8 +81,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 26ab44afcc..7ba9208a6a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -111,8 +111,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -123,8 +123,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql index a670ac2189..788131918a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -111,8 +111,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month @@ -123,8 +123,8 @@ FROM ( , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql index 3d88c96009..09e9a7df29 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,8 +160,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -172,8 +172,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -184,8 +184,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -197,8 +197,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -209,8 +209,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -266,8 +266,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -278,8 +278,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -290,8 +290,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -302,8 +302,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -338,8 +338,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -389,8 +389,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -401,8 +401,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -413,8 +413,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -426,8 +426,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -438,8 +438,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -450,8 +450,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql index e2ff275b47..2f56bdd23c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,8 +160,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -172,8 +172,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -184,8 +184,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -197,8 +197,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -209,8 +209,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -492,8 +492,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -504,8 +504,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -516,8 +516,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -529,8 +529,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -541,8 +541,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -553,8 +553,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 13d462ce84..c6aea810c4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,8 +160,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -172,8 +172,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -184,8 +184,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -197,8 +197,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -209,8 +209,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -492,8 +492,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -504,8 +504,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -516,8 +516,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -529,8 +529,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -541,8 +541,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -553,8 +553,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql index 7763daf079..0596eaabd8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,8 +160,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -172,8 +172,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -184,8 +184,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -197,8 +197,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -209,8 +209,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -492,8 +492,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -504,8 +504,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -516,8 +516,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -529,8 +529,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -541,8 +541,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -553,8 +553,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 8a1592b8e5..27218c34d0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,8 +160,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -172,8 +172,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -184,8 +184,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -197,8 +197,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -209,8 +209,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -492,8 +492,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -504,8 +504,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -516,8 +516,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -529,8 +529,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -541,8 +541,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -553,8 +553,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 793e7f674c..539423b5b3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -263,8 +263,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -275,8 +275,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -287,8 +287,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -300,8 +300,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -312,8 +312,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -324,8 +324,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -373,8 +373,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -385,8 +385,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -397,8 +397,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -409,8 +409,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -433,8 +433,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -475,8 +475,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -487,8 +487,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -499,8 +499,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -511,8 +511,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -523,8 +523,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -535,8 +535,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -547,8 +547,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -598,8 +598,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -610,8 +610,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -622,8 +622,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -635,8 +635,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -647,8 +647,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -659,8 +659,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index fd2a08f4dc..62ac8e39b4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -263,8 +263,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -275,8 +275,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -287,8 +287,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -300,8 +300,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -312,8 +312,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -324,8 +324,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -374,8 +374,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -386,8 +386,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -398,8 +398,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -410,8 +410,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -422,8 +422,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -434,8 +434,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -476,8 +476,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -599,8 +599,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -611,8 +611,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -623,8 +623,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -636,8 +636,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -648,8 +648,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -660,8 +660,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql index 9ff5c7ed82..23ad4fab94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_4.ds__extract_month AS ds__extract_month , subq_4.ds__extract_week AS ds__extract_week , subq_4.ds__extract_day AS ds__extract_day - , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_4.ds__extract_dow AS ds__extract_dow + , subq_4.ds__extract_doy AS ds__extract_doy , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_4.paid_at__extract_month AS paid_at__extract_month , subq_4.paid_at__extract_week AS paid_at__extract_week , subq_4.paid_at__extract_day AS paid_at__extract_day - , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_4.paid_at__extract_dow AS paid_at__extract_dow + , subq_4.paid_at__extract_doy AS paid_at__extract_doy , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_4.booking__ds__extract_month AS booking__ds__extract_month , subq_4.booking__ds__extract_week AS booking__ds__extract_week , subq_4.booking__ds__extract_day AS booking__ds__extract_day - , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_4.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_4.booking__ds__extract_doy AS booking__ds__extract_doy , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_4.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_4.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -135,8 +135,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -147,8 +147,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -159,8 +159,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -171,8 +171,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -183,8 +183,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -195,8 +195,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -206,8 +206,8 @@ FROM ( , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.metric_time__extract_week AS metric_time__extract_week , subq_1.metric_time__extract_day AS metric_time__extract_day - , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -248,8 +248,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -260,8 +260,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -272,8 +272,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -284,8 +284,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -296,8 +296,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -308,8 +308,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -320,8 +320,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -371,8 +371,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -383,8 +383,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -395,8 +395,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -408,8 +408,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -420,8 +420,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -432,8 +432,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql index 781610f066..6c3c772ab7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -134,8 +134,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -146,8 +146,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -158,8 +158,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -170,8 +170,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -206,8 +206,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -257,8 +257,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -269,8 +269,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -281,8 +281,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -294,8 +294,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -306,8 +306,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -318,8 +318,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql index 693e200db3..dae3f52e98 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -59,8 +59,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -71,8 +71,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -83,8 +83,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -95,8 +95,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -107,8 +107,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,8 +119,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -170,8 +170,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -194,8 +194,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -207,8 +207,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -219,8 +219,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -231,8 +231,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -262,8 +262,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -274,8 +274,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -298,8 +298,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -310,8 +310,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -340,8 +340,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -352,8 +352,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -367,8 +367,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -379,8 +379,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql index 00efad0383..395033b94a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql @@ -30,8 +30,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -42,8 +42,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -54,8 +54,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -67,8 +67,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql index 7e0fdff19e..18c852b528 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql @@ -36,8 +36,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -48,8 +48,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -73,8 +73,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql index 1a6844636c..028e45452a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -77,8 +77,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -89,8 +89,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,8 +125,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -176,8 +176,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -200,8 +200,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -213,8 +213,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -225,8 +225,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -237,8 +237,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -268,8 +268,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -280,8 +280,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -292,8 +292,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -316,8 +316,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -346,8 +346,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -358,8 +358,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -373,8 +373,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -385,8 +385,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql index 5712e1d25c..c2f4c8e617 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql @@ -55,8 +55,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -67,8 +67,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -79,8 +79,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -103,8 +103,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -115,8 +115,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -127,8 +127,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -164,8 +164,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month @@ -176,8 +176,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month @@ -188,8 +188,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week @@ -201,8 +201,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month @@ -213,8 +213,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month @@ -225,8 +225,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -260,8 +260,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month @@ -272,8 +272,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -287,8 +287,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month @@ -299,8 +299,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 141c4fba09..56ed62001f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,8 +165,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -177,8 +177,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -189,8 +189,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -202,8 +202,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -214,8 +214,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -226,8 +226,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql index 093b149ba2..7dafb98791 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,8 +165,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -177,8 +177,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -189,8 +189,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -202,8 +202,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -214,8 +214,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -226,8 +226,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql index 7c85ab1cdb..5bf86bf052 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,8 +165,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -177,8 +177,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -189,8 +189,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -202,8 +202,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -214,8 +214,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -226,8 +226,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql index e89a957806..1680cc5146 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql @@ -31,8 +31,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -43,8 +43,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -55,8 +55,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -67,8 +67,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -103,8 +103,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -154,8 +154,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -166,8 +166,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -178,8 +178,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -191,8 +191,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -203,8 +203,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -215,8 +215,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql index 436f0e7545..909e22c61e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month @@ -38,8 +38,8 @@ FROM ( , subq_0.created_at__extract_month , subq_0.created_at__extract_week , subq_0.created_at__extract_day - , subq_0.created_at__extract_dayofweek - , subq_0.created_at__extract_dayofyear + , subq_0.created_at__extract_dow + , subq_0.created_at__extract_doy , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month @@ -50,8 +50,8 @@ FROM ( , subq_0.listing__ds__extract_month , subq_0.listing__ds__extract_week , subq_0.listing__ds__extract_day - , subq_0.listing__ds__extract_dayofweek - , subq_0.listing__ds__extract_dayofyear + , subq_0.listing__ds__extract_dow + , subq_0.listing__ds__extract_doy , subq_0.listing__created_at__day , subq_0.listing__created_at__week , subq_0.listing__created_at__month @@ -62,8 +62,8 @@ FROM ( , subq_0.listing__created_at__extract_month , subq_0.listing__created_at__extract_week , subq_0.listing__created_at__extract_day - , subq_0.listing__created_at__extract_dayofweek - , subq_0.listing__created_at__extract_dayofyear + , subq_0.listing__created_at__extract_dow + , subq_0.listing__created_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -74,8 +74,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.user , subq_0.listing__user @@ -104,8 +104,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -116,8 +116,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -131,8 +131,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -143,8 +143,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql index b05da97264..65582ae31f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql @@ -40,8 +40,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -52,8 +52,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -64,8 +64,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -77,8 +77,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -89,8 +89,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -101,8 +101,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql index 9223eebd6e..f74d279e69 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql @@ -65,8 +65,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -89,8 +89,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -125,8 +125,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -137,8 +137,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -188,8 +188,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -200,8 +200,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -212,8 +212,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -225,8 +225,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -237,8 +237,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -249,8 +249,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -280,8 +280,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -316,8 +316,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -328,8 +328,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -358,8 +358,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -370,8 +370,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -385,8 +385,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -397,8 +397,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -476,8 +476,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -599,8 +599,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -611,8 +611,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -623,8 +623,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -636,8 +636,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -648,8 +648,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -660,8 +660,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -691,8 +691,8 @@ FROM ( , subq_15.ds__extract_month , subq_15.ds__extract_week , subq_15.ds__extract_day - , subq_15.ds__extract_dayofweek - , subq_15.ds__extract_dayofyear + , subq_15.ds__extract_dow + , subq_15.ds__extract_doy , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month @@ -703,8 +703,8 @@ FROM ( , subq_15.created_at__extract_month , subq_15.created_at__extract_week , subq_15.created_at__extract_day - , subq_15.created_at__extract_dayofweek - , subq_15.created_at__extract_dayofyear + , subq_15.created_at__extract_dow + , subq_15.created_at__extract_doy , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month @@ -715,8 +715,8 @@ FROM ( , subq_15.listing__ds__extract_month , subq_15.listing__ds__extract_week , subq_15.listing__ds__extract_day - , subq_15.listing__ds__extract_dayofweek - , subq_15.listing__ds__extract_dayofyear + , subq_15.listing__ds__extract_dow + , subq_15.listing__ds__extract_doy , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month @@ -727,8 +727,8 @@ FROM ( , subq_15.listing__created_at__extract_month , subq_15.listing__created_at__extract_week , subq_15.listing__created_at__extract_day - , subq_15.listing__created_at__extract_dayofweek - , subq_15.listing__created_at__extract_dayofyear + , subq_15.listing__created_at__extract_dow + , subq_15.listing__created_at__extract_doy , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -739,8 +739,8 @@ FROM ( , subq_15.ds__extract_month AS metric_time__extract_month , subq_15.ds__extract_week AS metric_time__extract_week , subq_15.ds__extract_day AS metric_time__extract_day - , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_15.ds__extract_dow AS metric_time__extract_dow + , subq_15.ds__extract_doy AS metric_time__extract_doy , subq_15.listing , subq_15.user , subq_15.listing__user @@ -769,8 +769,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -781,8 +781,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -796,8 +796,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -808,8 +808,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -870,8 +870,8 @@ FROM ( , subq_24.ds__extract_month , subq_24.ds__extract_week , subq_24.ds__extract_day - , subq_24.ds__extract_dayofweek - , subq_24.ds__extract_dayofyear + , subq_24.ds__extract_dow + , subq_24.ds__extract_doy , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month @@ -882,8 +882,8 @@ FROM ( , subq_24.ds_partitioned__extract_month , subq_24.ds_partitioned__extract_week , subq_24.ds_partitioned__extract_day - , subq_24.ds_partitioned__extract_dayofweek - , subq_24.ds_partitioned__extract_dayofyear + , subq_24.ds_partitioned__extract_dow + , subq_24.ds_partitioned__extract_doy , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month @@ -894,8 +894,8 @@ FROM ( , subq_24.paid_at__extract_month , subq_24.paid_at__extract_week , subq_24.paid_at__extract_day - , subq_24.paid_at__extract_dayofweek - , subq_24.paid_at__extract_dayofyear + , subq_24.paid_at__extract_dow + , subq_24.paid_at__extract_doy , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month @@ -906,8 +906,8 @@ FROM ( , subq_24.booking__ds__extract_month , subq_24.booking__ds__extract_week , subq_24.booking__ds__extract_day - , subq_24.booking__ds__extract_dayofweek - , subq_24.booking__ds__extract_dayofyear + , subq_24.booking__ds__extract_dow + , subq_24.booking__ds__extract_doy , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month @@ -918,8 +918,8 @@ FROM ( , subq_24.booking__ds_partitioned__extract_month , subq_24.booking__ds_partitioned__extract_week , subq_24.booking__ds_partitioned__extract_day - , subq_24.booking__ds_partitioned__extract_dayofweek - , subq_24.booking__ds_partitioned__extract_dayofyear + , subq_24.booking__ds_partitioned__extract_dow + , subq_24.booking__ds_partitioned__extract_doy , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month @@ -930,8 +930,8 @@ FROM ( , subq_24.booking__paid_at__extract_month , subq_24.booking__paid_at__extract_week , subq_24.booking__paid_at__extract_day - , subq_24.booking__paid_at__extract_dayofweek - , subq_24.booking__paid_at__extract_dayofyear + , subq_24.booking__paid_at__extract_dow + , subq_24.booking__paid_at__extract_doy , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -942,8 +942,8 @@ FROM ( , subq_24.ds__extract_month AS metric_time__extract_month , subq_24.ds__extract_week AS metric_time__extract_week , subq_24.ds__extract_day AS metric_time__extract_day - , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_24.ds__extract_dow AS metric_time__extract_dow + , subq_24.ds__extract_doy AS metric_time__extract_doy , subq_24.listing , subq_24.guest , subq_24.host @@ -993,8 +993,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -1005,8 +1005,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -1017,8 +1017,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -1030,8 +1030,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -1042,8 +1042,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -1054,8 +1054,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql index 1f9e7a4524..f536c2ec12 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -74,8 +74,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -86,8 +86,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,8 +122,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -173,8 +173,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -185,8 +185,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -197,8 +197,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -210,8 +210,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -222,8 +222,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -234,8 +234,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -282,8 +282,8 @@ FROM ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month @@ -294,8 +294,8 @@ FROM ( , subq_7.ds_partitioned__extract_month , subq_7.ds_partitioned__extract_week , subq_7.ds_partitioned__extract_day - , subq_7.ds_partitioned__extract_dayofweek - , subq_7.ds_partitioned__extract_dayofyear + , subq_7.ds_partitioned__extract_dow + , subq_7.ds_partitioned__extract_doy , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month @@ -306,8 +306,8 @@ FROM ( , subq_7.paid_at__extract_month , subq_7.paid_at__extract_week , subq_7.paid_at__extract_day - , subq_7.paid_at__extract_dayofweek - , subq_7.paid_at__extract_dayofyear + , subq_7.paid_at__extract_dow + , subq_7.paid_at__extract_doy , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month @@ -318,8 +318,8 @@ FROM ( , subq_7.booking__ds__extract_month , subq_7.booking__ds__extract_week , subq_7.booking__ds__extract_day - , subq_7.booking__ds__extract_dayofweek - , subq_7.booking__ds__extract_dayofyear + , subq_7.booking__ds__extract_dow + , subq_7.booking__ds__extract_doy , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month @@ -330,8 +330,8 @@ FROM ( , subq_7.booking__ds_partitioned__extract_month , subq_7.booking__ds_partitioned__extract_week , subq_7.booking__ds_partitioned__extract_day - , subq_7.booking__ds_partitioned__extract_dayofweek - , subq_7.booking__ds_partitioned__extract_dayofyear + , subq_7.booking__ds_partitioned__extract_dow + , subq_7.booking__ds_partitioned__extract_doy , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month @@ -342,8 +342,8 @@ FROM ( , subq_7.booking__paid_at__extract_month , subq_7.booking__paid_at__extract_week , subq_7.booking__paid_at__extract_day - , subq_7.booking__paid_at__extract_dayofweek - , subq_7.booking__paid_at__extract_dayofyear + , subq_7.booking__paid_at__extract_dow + , subq_7.booking__paid_at__extract_doy , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -354,8 +354,8 @@ FROM ( , subq_7.ds__extract_month AS metric_time__extract_month , subq_7.ds__extract_week AS metric_time__extract_week , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -405,8 +405,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -429,8 +429,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -442,8 +442,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -454,8 +454,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -466,8 +466,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 2d8a10e755..61e0a3c0e0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -44,8 +44,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -56,8 +56,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -68,8 +68,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,8 +116,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -167,8 +167,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -179,8 +179,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -191,8 +191,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -204,8 +204,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -216,8 +216,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -228,8 +228,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 4ef0714be2..59683b27c8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,8 +155,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -167,8 +167,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -179,8 +179,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -192,8 +192,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -204,8 +204,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -216,8 +216,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -256,8 +256,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month @@ -268,8 +268,8 @@ FROM ( , subq_5.created_at__extract_month , subq_5.created_at__extract_week , subq_5.created_at__extract_day - , subq_5.created_at__extract_dayofweek - , subq_5.created_at__extract_dayofyear + , subq_5.created_at__extract_dow + , subq_5.created_at__extract_doy , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month @@ -280,8 +280,8 @@ FROM ( , subq_5.listing__ds__extract_month , subq_5.listing__ds__extract_week , subq_5.listing__ds__extract_day - , subq_5.listing__ds__extract_dayofweek - , subq_5.listing__ds__extract_dayofyear + , subq_5.listing__ds__extract_dow + , subq_5.listing__ds__extract_doy , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_5.listing__created_at__extract_month , subq_5.listing__created_at__extract_week , subq_5.listing__created_at__extract_day - , subq_5.listing__created_at__extract_dayofweek - , subq_5.listing__created_at__extract_dayofyear + , subq_5.listing__created_at__extract_dow + , subq_5.listing__created_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -304,8 +304,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.user , subq_5.listing__user @@ -334,8 +334,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -346,8 +346,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -361,8 +361,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -373,8 +373,8 @@ FROM ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql index db50a9f2c8..3f01da6648 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -154,8 +154,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month @@ -166,8 +166,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month @@ -178,8 +178,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week @@ -191,8 +191,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month @@ -203,8 +203,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month @@ -215,8 +215,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -250,8 +250,8 @@ FROM ( , subq_3.window_start__extract_month AS window_start__extract_month , subq_3.window_start__extract_week AS window_start__extract_week , subq_3.window_start__extract_day AS window_start__extract_day - , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek - , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear + , subq_3.window_start__extract_dow AS window_start__extract_dow + , subq_3.window_start__extract_doy AS window_start__extract_doy , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month @@ -262,8 +262,8 @@ FROM ( , subq_3.window_end__extract_month AS window_end__extract_month , subq_3.window_end__extract_week AS window_end__extract_week , subq_3.window_end__extract_day AS window_end__extract_day - , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek - , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear + , subq_3.window_end__extract_dow AS window_end__extract_dow + , subq_3.window_end__extract_doy AS window_end__extract_doy , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month @@ -274,8 +274,8 @@ FROM ( , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day - , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek - , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_3.listing__window_start__extract_dow AS listing__window_start__extract_dow + , subq_3.listing__window_start__extract_doy AS listing__window_start__extract_doy , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day - , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek - , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_3.listing__window_end__extract_dow AS listing__window_end__extract_dow + , subq_3.listing__window_end__extract_doy AS listing__window_end__extract_doy , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month @@ -298,8 +298,8 @@ FROM ( , subq_5.ds__extract_month AS user__ds__extract_month , subq_5.ds__extract_week AS user__ds__extract_week , subq_5.ds__extract_day AS user__ds__extract_day - , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek - , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear + , subq_5.ds__extract_dow AS user__ds__extract_dow + , subq_5.ds__extract_doy AS user__ds__extract_doy , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -323,8 +323,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month @@ -335,8 +335,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -350,8 +350,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month @@ -362,8 +362,8 @@ FROM ( , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -412,8 +412,8 @@ FROM ( , subq_4.ds__extract_month , subq_4.ds__extract_week , subq_4.ds__extract_day - , subq_4.ds__extract_dayofweek - , subq_4.ds__extract_dayofyear + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month @@ -424,8 +424,8 @@ FROM ( , subq_4.user__ds__extract_month , subq_4.user__ds__extract_week , subq_4.user__ds__extract_day - , subq_4.user__ds__extract_dayofweek - , subq_4.user__ds__extract_dayofyear + , subq_4.user__ds__extract_dow + , subq_4.user__ds__extract_doy , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -442,8 +442,8 @@ FROM ( , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week @@ -455,8 +455,8 @@ FROM ( , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql index adaf16cf58..2303464654 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -154,8 +154,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month @@ -166,8 +166,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month @@ -178,8 +178,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week @@ -191,8 +191,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month @@ -203,8 +203,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month @@ -215,8 +215,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -253,8 +253,8 @@ FROM ( , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day - , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek - , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear + , subq_5.window_start__extract_dow AS lux_listing__window_start__extract_dow + , subq_5.window_start__extract_doy AS lux_listing__window_start__extract_doy , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month @@ -265,8 +265,8 @@ FROM ( , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day - , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek - , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear + , subq_5.window_end__extract_dow AS lux_listing__window_end__extract_dow + , subq_5.window_end__extract_doy AS lux_listing__window_end__extract_doy , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -343,8 +343,8 @@ FROM ( , subq_4.window_start__extract_month , subq_4.window_start__extract_week , subq_4.window_start__extract_day - , subq_4.window_start__extract_dayofweek - , subq_4.window_start__extract_dayofyear + , subq_4.window_start__extract_dow + , subq_4.window_start__extract_doy , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month @@ -355,8 +355,8 @@ FROM ( , subq_4.window_end__extract_month , subq_4.window_end__extract_week , subq_4.window_end__extract_day - , subq_4.window_end__extract_dayofweek - , subq_4.window_end__extract_dayofyear + , subq_4.window_end__extract_dow + , subq_4.window_end__extract_doy , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month @@ -367,8 +367,8 @@ FROM ( , subq_4.lux_listing__window_start__extract_month , subq_4.lux_listing__window_start__extract_week , subq_4.lux_listing__window_start__extract_day - , subq_4.lux_listing__window_start__extract_dayofweek - , subq_4.lux_listing__window_start__extract_dayofyear + , subq_4.lux_listing__window_start__extract_dow + , subq_4.lux_listing__window_start__extract_doy , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month @@ -379,8 +379,8 @@ FROM ( , subq_4.lux_listing__window_end__extract_month , subq_4.lux_listing__window_end__extract_week , subq_4.lux_listing__window_end__extract_day - , subq_4.lux_listing__window_end__extract_dayofweek - , subq_4.lux_listing__window_end__extract_dayofyear + , subq_4.lux_listing__window_end__extract_dow + , subq_4.lux_listing__window_end__extract_doy , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -397,8 +397,8 @@ FROM ( , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month @@ -409,8 +409,8 @@ FROM ( , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week @@ -422,8 +422,8 @@ FROM ( , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month @@ -434,8 +434,8 @@ FROM ( , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql index cb9670f074..2ef9e97902 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql @@ -38,8 +38,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -75,8 +75,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -87,8 +87,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -99,8 +99,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -132,8 +132,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -144,8 +144,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -159,8 +159,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -171,8 +171,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -206,8 +206,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -218,8 +218,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -233,8 +233,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -245,8 +245,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql index 7638105966..5a28324203 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.account_id__ds_partitioned__day , subq_0.account_id__ds_partitioned__week , subq_0.account_id__ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.account_id__ds_partitioned__extract_month , subq_0.account_id__ds_partitioned__extract_week , subq_0.account_id__ds_partitioned__extract_day - , subq_0.account_id__ds_partitioned__extract_dayofweek - , subq_0.account_id__ds_partitioned__extract_dayofyear + , subq_0.account_id__ds_partitioned__extract_dow + , subq_0.account_id__ds_partitioned__extract_doy , subq_0.account_id__ds__day , subq_0.account_id__ds__week , subq_0.account_id__ds__month @@ -77,8 +77,8 @@ FROM ( , subq_0.account_id__ds__extract_month , subq_0.account_id__ds__extract_week , subq_0.account_id__ds__extract_day - , subq_0.account_id__ds__extract_dayofweek - , subq_0.account_id__ds__extract_dayofyear + , subq_0.account_id__ds__extract_dow + , subq_0.account_id__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month @@ -109,8 +109,8 @@ FROM ( , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month @@ -121,8 +121,8 @@ FROM ( , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week @@ -134,8 +134,8 @@ FROM ( , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month @@ -146,8 +146,8 @@ FROM ( , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -174,8 +174,8 @@ FROM ( , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_3.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_3.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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 @@ -186,8 +186,8 @@ FROM ( , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day - , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek - , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear + , subq_3.account_id__ds_partitioned__extract_dow AS account_id__ds_partitioned__extract_dow + , subq_3.account_id__ds_partitioned__extract_doy AS account_id__ds_partitioned__extract_doy , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month @@ -198,8 +198,8 @@ FROM ( , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow AS customer_id__ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy AS customer_id__ds_partitioned__extract_doy , 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 @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week @@ -234,8 +234,8 @@ FROM ( , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -283,8 +283,8 @@ FROM ( , subq_4.ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy , subq_4.customer_id__ds_partitioned__day , subq_4.customer_id__ds_partitioned__week , subq_4.customer_id__ds_partitioned__month @@ -295,8 +295,8 @@ FROM ( , subq_4.customer_id__ds_partitioned__extract_month , subq_4.customer_id__ds_partitioned__extract_week , subq_4.customer_id__ds_partitioned__extract_day - , subq_4.customer_id__ds_partitioned__extract_dayofweek - , subq_4.customer_id__ds_partitioned__extract_dayofyear + , subq_4.customer_id__ds_partitioned__extract_dow + , subq_4.customer_id__ds_partitioned__extract_doy , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -317,8 +317,8 @@ FROM ( , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -331,8 +331,8 @@ FROM ( , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql index 3d8fba9b22..38e701d35f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql @@ -28,8 +28,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month @@ -40,8 +40,8 @@ FROM ( , subq_1.ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month @@ -52,8 +52,8 @@ FROM ( , subq_1.paid_at__extract_month , subq_1.paid_at__extract_week , subq_1.paid_at__extract_day - , subq_1.paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow + , subq_1.paid_at__extract_doy , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month @@ -64,8 +64,8 @@ FROM ( , subq_1.booking__ds__extract_month , subq_1.booking__ds__extract_week , subq_1.booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow + , subq_1.booking__ds__extract_doy , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month @@ -76,8 +76,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month @@ -88,8 +88,8 @@ FROM ( , subq_1.booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -100,8 +100,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.listing , subq_1.guest , subq_1.host @@ -136,8 +136,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -160,8 +160,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -172,8 +172,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -196,8 +196,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -208,8 +208,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -259,8 +259,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -271,8 +271,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -283,8 +283,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -296,8 +296,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -308,8 +308,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -320,8 +320,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -362,8 +362,8 @@ CROSS JOIN ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month @@ -374,8 +374,8 @@ CROSS JOIN ( , subq_7.created_at__extract_month , subq_7.created_at__extract_week , subq_7.created_at__extract_day - , subq_7.created_at__extract_dayofweek - , subq_7.created_at__extract_dayofyear + , subq_7.created_at__extract_dow + , subq_7.created_at__extract_doy , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month @@ -386,8 +386,8 @@ CROSS JOIN ( , subq_7.listing__ds__extract_month , subq_7.listing__ds__extract_week , subq_7.listing__ds__extract_day - , subq_7.listing__ds__extract_dayofweek - , subq_7.listing__ds__extract_dayofyear + , subq_7.listing__ds__extract_dow + , subq_7.listing__ds__extract_doy , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month @@ -398,8 +398,8 @@ CROSS JOIN ( , subq_7.listing__created_at__extract_month , subq_7.listing__created_at__extract_week , subq_7.listing__created_at__extract_day - , subq_7.listing__created_at__extract_dayofweek - , subq_7.listing__created_at__extract_dayofyear + , subq_7.listing__created_at__extract_dow + , subq_7.listing__created_at__extract_doy , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -410,8 +410,8 @@ CROSS JOIN ( , subq_7.metric_time__extract_month , subq_7.metric_time__extract_week , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dayofweek - , subq_7.metric_time__extract_dayofyear + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.user , subq_7.listing__user @@ -437,8 +437,8 @@ CROSS JOIN ( , subq_6.ds__extract_month , subq_6.ds__extract_week , subq_6.ds__extract_day - , subq_6.ds__extract_dayofweek - , subq_6.ds__extract_dayofyear + , subq_6.ds__extract_dow + , subq_6.ds__extract_doy , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month @@ -449,8 +449,8 @@ CROSS JOIN ( , subq_6.created_at__extract_month , subq_6.created_at__extract_week , subq_6.created_at__extract_day - , subq_6.created_at__extract_dayofweek - , subq_6.created_at__extract_dayofyear + , subq_6.created_at__extract_dow + , subq_6.created_at__extract_doy , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month @@ -461,8 +461,8 @@ CROSS JOIN ( , subq_6.listing__ds__extract_month , subq_6.listing__ds__extract_week , subq_6.listing__ds__extract_day - , subq_6.listing__ds__extract_dayofweek - , subq_6.listing__ds__extract_dayofyear + , subq_6.listing__ds__extract_dow + , subq_6.listing__ds__extract_doy , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month @@ -473,8 +473,8 @@ CROSS JOIN ( , subq_6.listing__created_at__extract_month , subq_6.listing__created_at__extract_week , subq_6.listing__created_at__extract_day - , subq_6.listing__created_at__extract_dayofweek - , subq_6.listing__created_at__extract_dayofyear + , subq_6.listing__created_at__extract_dow + , subq_6.listing__created_at__extract_doy , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -485,8 +485,8 @@ CROSS JOIN ( , subq_6.ds__extract_month AS metric_time__extract_month , subq_6.ds__extract_week AS metric_time__extract_week , subq_6.ds__extract_day AS metric_time__extract_day - , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_6.ds__extract_dow AS metric_time__extract_dow + , subq_6.ds__extract_doy AS metric_time__extract_doy , subq_6.listing , subq_6.user , subq_6.listing__user @@ -515,8 +515,8 @@ CROSS JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -527,8 +527,8 @@ CROSS JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -542,8 +542,8 @@ CROSS JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -554,8 +554,8 @@ CROSS JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql index 138d3b47ca..c84ceda6fa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql @@ -49,8 +49,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -73,8 +73,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -109,8 +109,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -121,8 +121,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -172,8 +172,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -196,8 +196,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -209,8 +209,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -221,8 +221,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -233,8 +233,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -278,8 +278,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -290,8 +290,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -302,8 +302,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -338,8 +338,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -350,8 +350,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -401,8 +401,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -413,8 +413,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -425,8 +425,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -438,8 +438,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -450,8 +450,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -462,8 +462,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -519,8 +519,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -531,8 +531,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -543,8 +543,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -555,8 +555,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -567,8 +567,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -579,8 +579,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -591,8 +591,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -642,8 +642,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -654,8 +654,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -666,8 +666,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -679,8 +679,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -691,8 +691,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -703,8 +703,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -758,8 +758,8 @@ FROM ( , subq_17.ds__extract_month , subq_17.ds__extract_week , subq_17.ds__extract_day - , subq_17.ds__extract_dayofweek - , subq_17.ds__extract_dayofyear + , subq_17.ds__extract_dow + , subq_17.ds__extract_doy , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month @@ -770,8 +770,8 @@ FROM ( , subq_17.ds_partitioned__extract_month , subq_17.ds_partitioned__extract_week , subq_17.ds_partitioned__extract_day - , subq_17.ds_partitioned__extract_dayofweek - , subq_17.ds_partitioned__extract_dayofyear + , subq_17.ds_partitioned__extract_dow + , subq_17.ds_partitioned__extract_doy , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month @@ -782,8 +782,8 @@ FROM ( , subq_17.paid_at__extract_month , subq_17.paid_at__extract_week , subq_17.paid_at__extract_day - , subq_17.paid_at__extract_dayofweek - , subq_17.paid_at__extract_dayofyear + , subq_17.paid_at__extract_dow + , subq_17.paid_at__extract_doy , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month @@ -794,8 +794,8 @@ FROM ( , subq_17.booking__ds__extract_month , subq_17.booking__ds__extract_week , subq_17.booking__ds__extract_day - , subq_17.booking__ds__extract_dayofweek - , subq_17.booking__ds__extract_dayofyear + , subq_17.booking__ds__extract_dow + , subq_17.booking__ds__extract_doy , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month @@ -806,8 +806,8 @@ FROM ( , subq_17.booking__ds_partitioned__extract_month , subq_17.booking__ds_partitioned__extract_week , subq_17.booking__ds_partitioned__extract_day - , subq_17.booking__ds_partitioned__extract_dayofweek - , subq_17.booking__ds_partitioned__extract_dayofyear + , subq_17.booking__ds_partitioned__extract_dow + , subq_17.booking__ds_partitioned__extract_doy , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month @@ -818,8 +818,8 @@ FROM ( , subq_17.booking__paid_at__extract_month , subq_17.booking__paid_at__extract_week , subq_17.booking__paid_at__extract_day - , subq_17.booking__paid_at__extract_dayofweek - , subq_17.booking__paid_at__extract_dayofyear + , subq_17.booking__paid_at__extract_dow + , subq_17.booking__paid_at__extract_doy , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -830,8 +830,8 @@ FROM ( , subq_17.ds__extract_month AS metric_time__extract_month , subq_17.ds__extract_week AS metric_time__extract_week , subq_17.ds__extract_day AS metric_time__extract_day - , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_17.ds__extract_dow AS metric_time__extract_dow + , subq_17.ds__extract_doy AS metric_time__extract_doy , subq_17.listing , subq_17.guest , subq_17.host @@ -881,8 +881,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -893,8 +893,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -905,8 +905,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -918,8 +918,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -930,8 +930,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -942,8 +942,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql index 63116a5458..d9c8ed0995 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql @@ -50,8 +50,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -74,8 +74,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -87,8 +87,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -99,8 +99,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -111,8 +111,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql index e43e265eff..73a3eb36fd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month @@ -65,8 +65,8 @@ FROM ( , subq_0.verification__ds__extract_month , subq_0.verification__ds__extract_week , subq_0.verification__ds__extract_day - , subq_0.verification__ds__extract_dayofweek - , subq_0.verification__ds__extract_dayofyear + , subq_0.verification__ds__extract_dow + , subq_0.verification__ds__extract_doy , subq_0.verification__ds_partitioned__day , subq_0.verification__ds_partitioned__week , subq_0.verification__ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.verification__ds_partitioned__extract_month , subq_0.verification__ds_partitioned__extract_week , subq_0.verification__ds_partitioned__extract_day - , subq_0.verification__ds_partitioned__extract_dayofweek - , subq_0.verification__ds_partitioned__extract_dayofyear + , subq_0.verification__ds_partitioned__extract_dow + , subq_0.verification__ds_partitioned__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.verification , subq_0.user , subq_0.verification__user @@ -111,8 +111,8 @@ FROM ( , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month @@ -123,8 +123,8 @@ FROM ( , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week @@ -136,8 +136,8 @@ FROM ( , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -178,8 +178,8 @@ FROM ( , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month @@ -190,8 +190,8 @@ FROM ( , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month @@ -202,8 +202,8 @@ FROM ( , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week @@ -215,8 +215,8 @@ FROM ( , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month @@ -227,8 +227,8 @@ FROM ( , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month @@ -239,8 +239,8 @@ FROM ( , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql index d88d2d32f3..bf73140286 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -47,8 +47,8 @@ FROM ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -87,8 +87,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week @@ -100,8 +100,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql index 094486f462..37fb636c96 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -47,8 +47,8 @@ FROM ( , EXTRACT(MONTH FROM ds) AS ds__extract_month , EXTRACT(WEEK FROM ds) AS ds__extract_week , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM ds) AS account__ds__extract_month , EXTRACT(WEEK FROM ds) AS account__ds__extract_week , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql index a8a26c9899..5801bf4ecd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -47,8 +47,8 @@ FROM ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -88,8 +88,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week @@ -101,8 +101,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index c400372dd4..b83343fe92 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -47,8 +47,8 @@ FROM ( , EXTRACT(MONTH FROM ds) AS ds__extract_month , EXTRACT(WEEK FROM ds) AS ds__extract_week , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM ds) AS account__ds__extract_month , EXTRACT(WEEK FROM ds) AS account__ds__extract_week , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 30ab4c1851..d76c04b1c2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -47,8 +47,8 @@ FROM ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -88,8 +88,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week @@ -101,8 +101,8 @@ INNER JOIN ( , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ef337f422c..7b9abd7ccb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -47,8 +47,8 @@ FROM ( , EXTRACT(MONTH FROM ds) AS ds__extract_month , EXTRACT(WEEK FROM ds) AS ds__extract_week , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM ds) AS account__ds__extract_month , EXTRACT(WEEK FROM ds) AS account__ds__extract_week , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql index 16b897731d..79dbc6f87e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql @@ -36,8 +36,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -48,8 +48,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -60,8 +60,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -73,8 +73,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -130,8 +130,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month @@ -142,8 +142,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -157,8 +157,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month @@ -169,8 +169,8 @@ LEFT OUTER JOIN ( , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql index 7dd5c3b39d..a046c27cbb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql @@ -25,8 +25,8 @@ SELECT , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -37,8 +37,8 @@ SELECT , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -49,8 +49,8 @@ SELECT , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -62,8 +62,8 @@ SELECT , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -74,8 +74,8 @@ SELECT , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -86,8 +86,8 @@ SELECT , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql index e240956212..fd0050700e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql @@ -25,8 +25,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS ds__extract_month , EXTRACT(WEEK FROM ds) AS ds__extract_week , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month @@ -37,8 +37,8 @@ SELECT , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month @@ -49,8 +49,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week @@ -62,8 +62,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month @@ -74,8 +74,8 @@ SELECT , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month @@ -86,8 +86,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml index 97591729c5..d5208d36cf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_common_semantic_model__plan0.xml @@ -117,11 +117,11 @@ - + - + @@ -165,11 +165,11 @@ - + - + @@ -213,11 +213,11 @@ - + - + @@ -261,11 +261,11 @@ - + - + @@ -306,14 +306,14 @@ - - - - - - - - + + + + + + + + @@ -354,14 +354,14 @@ - - - - - - - - + + + + + + + + @@ -405,11 +405,11 @@ - + - + @@ -602,11 +602,11 @@ - + - + @@ -647,14 +647,14 @@ - - - - - - - - + + + + + + + + @@ -698,11 +698,11 @@ - + - + @@ -747,14 +747,14 @@ - - - - - - - - + + + + + + + + @@ -795,14 +795,14 @@ - - - - - - - - + + + + + + + + @@ -843,14 +843,14 @@ - - - - - - - - + + + + + + + + @@ -978,11 +978,11 @@ - + - + @@ -1026,11 +1026,11 @@ - + - + @@ -1074,11 +1074,11 @@ - + - + @@ -1122,11 +1122,11 @@ - + - + @@ -1167,14 +1167,14 @@ - - - - - - - - + + + + + + + + @@ -1215,14 +1215,14 @@ - - - - - - - - + + + + + + + + @@ -1266,11 +1266,11 @@ - + - + @@ -1463,11 +1463,11 @@ - + - + @@ -1508,14 +1508,14 @@ - - - - - - - - + + + + + + + + @@ -1559,11 +1559,11 @@ - + - + @@ -1608,14 +1608,14 @@ - - - - - - - - + + + + + + + + @@ -1656,14 +1656,14 @@ - - - - - - - - + + + + + + + + @@ -1704,14 +1704,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml index 34419b3c74..2660580f8d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node__plan0.xml @@ -185,11 +185,11 @@ - + - + @@ -230,14 +230,14 @@ - - - - - - - - + + + + + + + + @@ -281,11 +281,11 @@ - + - + @@ -330,14 +330,14 @@ - - - - - - - - + + + + + + + + @@ -378,14 +378,14 @@ - - - - - - - - + + + + + + + + @@ -426,14 +426,14 @@ - - - - - - - - + + + + + + + + @@ -540,11 +540,11 @@ - + - + @@ -585,14 +585,14 @@ - - - - - - - - + + + + + + + + @@ -645,14 +645,14 @@ - - - - - - - - + + + + + + + + @@ -693,14 +693,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml index 7fc551df80..543c84a88f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.xml @@ -196,11 +196,11 @@ - + - + @@ -244,11 +244,11 @@ - + - + @@ -292,11 +292,11 @@ - + - + @@ -340,11 +340,11 @@ - + - + @@ -385,14 +385,14 @@ - - - - - - - - + + + + + + + + @@ -433,14 +433,14 @@ - - - - - - - - + + + + + + + + @@ -484,11 +484,11 @@ - + - + @@ -681,11 +681,11 @@ - + - + @@ -726,14 +726,14 @@ - - - - - - - - + + + + + + + + @@ -777,11 +777,11 @@ - + - + @@ -826,14 +826,14 @@ - - - - - - - - + + + + + + + + @@ -874,14 +874,14 @@ - - - - - - - - + + + + + + + + @@ -922,14 +922,14 @@ - - - - - - - - + + + + + + + + @@ -1025,11 +1025,11 @@ - + - + @@ -1073,11 +1073,11 @@ - + - + @@ -1121,11 +1121,11 @@ - + - + @@ -1166,14 +1166,14 @@ - - - - - - - - + + + + + + + + @@ -1217,11 +1217,11 @@ - + - + @@ -1330,11 +1330,11 @@ - + - + @@ -1375,14 +1375,14 @@ - - - - - - - - + + + + + + + + @@ -1435,14 +1435,14 @@ - - - - - - - - + + + + + + + + @@ -1483,14 +1483,14 @@ - - - - - - - - + + + + + + + + @@ -1682,11 +1682,11 @@ - + - + @@ -1730,11 +1730,11 @@ - + - + @@ -1778,11 +1778,11 @@ - + - + @@ -1823,14 +1823,14 @@ - - - - - - - - + + + + + + + + @@ -1874,11 +1874,11 @@ - + - + @@ -1951,11 +1951,11 @@ - + - + @@ -1996,14 +1996,14 @@ - - - - - - - - + + + + + + + + @@ -2047,11 +2047,11 @@ - + - + @@ -2092,14 +2092,14 @@ - - - - - - - - + + + + + + + + @@ -2187,11 +2187,11 @@ - + - + @@ -2235,11 +2235,11 @@ - + - + @@ -2283,11 +2283,11 @@ - + - + @@ -2328,14 +2328,14 @@ - - - - - - - - + + + + + + + + @@ -2379,11 +2379,11 @@ - + - + @@ -2492,11 +2492,11 @@ - + - + @@ -2537,14 +2537,14 @@ - - - - - - - - + + + + + + + + @@ -2597,14 +2597,14 @@ - - - - - - - - + + + + + + + + @@ -2645,14 +2645,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml index 95cd7fa4a4..9caab95d18 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.xml @@ -197,11 +197,11 @@ - + - + @@ -242,14 +242,14 @@ - - - - - - - - + + + + + + + + @@ -293,11 +293,11 @@ - + - + @@ -342,14 +342,14 @@ - - - - - - - - + + + + + + + + @@ -390,14 +390,14 @@ - - - - - - - - + + + + + + + + @@ -438,14 +438,14 @@ - - - - - - - - + + + + + + + + @@ -552,11 +552,11 @@ - + - + @@ -597,14 +597,14 @@ - - - - - - - - + + + + + + + + @@ -657,14 +657,14 @@ - - - - - - - - + + + + + + + + @@ -705,14 +705,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml index 9f5069ebd5..5510083da3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_compute_metrics_node_simple_expr__plan0.xml @@ -185,11 +185,11 @@ - + - + @@ -230,14 +230,14 @@ - - - - - - - - + + + + + + + + @@ -281,11 +281,11 @@ - + - + @@ -330,14 +330,14 @@ - - - - - - - - + + + + + + + + @@ -378,14 +378,14 @@ - - - - - - - - + + + + + + + + @@ -426,14 +426,14 @@ - - - - - - - - + + + + + + + + @@ -540,11 +540,11 @@ - + - + @@ -585,14 +585,14 @@ - - - - - - - - + + + + + + + + @@ -645,14 +645,14 @@ - - - - - - - - + + + + + + + + @@ -693,14 +693,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml index 4dbe746624..6832ab1d88 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_constrain_time_range_node__plan0.xml @@ -155,11 +155,11 @@ - + - + @@ -200,14 +200,14 @@ - - - - - - - - + + + + + + + + @@ -251,11 +251,11 @@ - + - + @@ -300,14 +300,14 @@ - - - - - - - - + + + + + + + + @@ -348,14 +348,14 @@ - - - - - - - - + + + + + + + + @@ -396,14 +396,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml index 37c8fa43eb..6a4f2968b1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric__plan0.xml @@ -90,11 +90,11 @@ - + - + @@ -138,11 +138,11 @@ - + - + @@ -186,11 +186,11 @@ - + - + @@ -255,11 +255,11 @@ - + - + @@ -300,14 +300,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml index 5dc0f7e4cf..05e69c0c94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_grain_to_date__plan0.xml @@ -90,11 +90,11 @@ - + - + @@ -138,11 +138,11 @@ - + - + @@ -186,11 +186,11 @@ - + - + @@ -255,11 +255,11 @@ - + - + @@ -300,14 +300,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml index ea17474430..c44152f685 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_ds__plan0.xml @@ -74,11 +74,11 @@ - + - + @@ -122,11 +122,11 @@ - + - + @@ -170,11 +170,11 @@ - + - + @@ -239,11 +239,11 @@ - + - + @@ -284,14 +284,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml index e1894ad698..c246fb55db 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window__plan0.xml @@ -90,11 +90,11 @@ - + - + @@ -138,11 +138,11 @@ - + - + @@ -186,11 +186,11 @@ - + - + @@ -255,11 +255,11 @@ - + - + @@ -300,14 +300,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml index 015b695d28..11c4a6ef28 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_no_window_with_time_constraint__plan0.xml @@ -91,11 +91,11 @@ - + - + @@ -139,11 +139,11 @@ - + - + @@ -187,11 +187,11 @@ - + - + @@ -252,11 +252,11 @@ - + - + @@ -300,11 +300,11 @@ - + - + @@ -348,11 +348,11 @@ - + - + @@ -417,11 +417,11 @@ - + - + @@ -462,14 +462,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml index dfb4ab1ff7..69648ea206 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_cumulative_metric_with_time_constraint__plan0.xml @@ -91,11 +91,11 @@ - + - + @@ -139,11 +139,11 @@ - + - + @@ -187,11 +187,11 @@ - + - + @@ -252,11 +252,11 @@ - + - + @@ -300,11 +300,11 @@ - + - + @@ -348,11 +348,11 @@ - + - + @@ -417,11 +417,11 @@ - + - + @@ -462,14 +462,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml index dd9355e958..c527d74a06 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric__plan0.xml @@ -126,11 +126,11 @@ - + - + @@ -174,11 +174,11 @@ - + - + @@ -222,11 +222,11 @@ - + - + @@ -270,11 +270,11 @@ - + - + @@ -315,14 +315,14 @@ - - - - - - - - + + + + + + + + @@ -363,14 +363,14 @@ - - - - - - - - + + + + + + + + @@ -414,11 +414,11 @@ - + - + @@ -611,11 +611,11 @@ - + - + @@ -656,14 +656,14 @@ - - - - - - - - + + + + + + + + @@ -707,11 +707,11 @@ - + - + @@ -756,14 +756,14 @@ - - - - - - - - + + + + + + + + @@ -804,14 +804,14 @@ - - - - - - - - + + + + + + + + @@ -852,14 +852,14 @@ - - - - - - - - + + + + + + + + @@ -987,11 +987,11 @@ - + - + @@ -1035,11 +1035,11 @@ - + - + @@ -1083,11 +1083,11 @@ - + - + @@ -1131,11 +1131,11 @@ - + - + @@ -1176,14 +1176,14 @@ - - - - - - - - + + + + + + + + @@ -1224,14 +1224,14 @@ - - - - - - - - + + + + + + + + @@ -1275,11 +1275,11 @@ - + - + @@ -1472,11 +1472,11 @@ - + - + @@ -1517,14 +1517,14 @@ - - - - - - - - + + + + + + + + @@ -1568,11 +1568,11 @@ - + - + @@ -1617,14 +1617,14 @@ - - - - - - - - + + + + + + + + @@ -1665,14 +1665,14 @@ - - - - - - - - + + + + + + + + @@ -1713,14 +1713,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml index d630756d83..d35dd96911 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain__plan0.xml @@ -126,11 +126,11 @@ - + - + @@ -174,11 +174,11 @@ - + - + @@ -222,11 +222,11 @@ - + - + @@ -270,11 +270,11 @@ - + - + @@ -315,14 +315,14 @@ - - - - - - - - + + + + + + + + @@ -363,14 +363,14 @@ - - - - - - - - + + + + + + + + @@ -414,11 +414,11 @@ - + - + @@ -611,11 +611,11 @@ - + - + @@ -656,14 +656,14 @@ - - - - - - - - + + + + + + + + @@ -707,11 +707,11 @@ - + - + @@ -756,14 +756,14 @@ - - - - - - - - + + + + + + + + @@ -804,14 +804,14 @@ - - - - - - - - + + + + + + + + @@ -852,14 +852,14 @@ - - - - - - - - + + + + + + + + @@ -991,11 +991,11 @@ - + - + @@ -1039,11 +1039,11 @@ - + - + @@ -1087,11 +1087,11 @@ - + - + @@ -1135,11 +1135,11 @@ - + - + @@ -1180,14 +1180,14 @@ - - - - - - - - + + + + + + + + @@ -1228,14 +1228,14 @@ - - - - - - - - + + + + + + + + @@ -1389,11 +1389,11 @@ - + - + @@ -1437,11 +1437,11 @@ - + - + @@ -1485,11 +1485,11 @@ - + - + @@ -1533,11 +1533,11 @@ - + - + @@ -1578,14 +1578,14 @@ - - - - - - - - + + + + + + + + @@ -1626,14 +1626,14 @@ - - - - - - - - + + + + + + + + @@ -1677,11 +1677,11 @@ - + - + @@ -1874,11 +1874,11 @@ - + - + @@ -1919,14 +1919,14 @@ - - - - - - - - + + + + + + + + @@ -1970,11 +1970,11 @@ - + - + @@ -2019,14 +2019,14 @@ - - - - - - - - + + + + + + + + @@ -2067,14 +2067,14 @@ - - - - - - - - + + + + + + + + @@ -2115,14 +2115,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml index 62931da30f..6b48478444 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_to_grain_and_granularity__plan0.xml @@ -126,11 +126,11 @@ - + - + @@ -174,11 +174,11 @@ - + - + @@ -222,11 +222,11 @@ - + - + @@ -270,11 +270,11 @@ - + - + @@ -315,14 +315,14 @@ - - - - - - - - + + + + + + + + @@ -363,14 +363,14 @@ - - - - - - - - + + + + + + + + @@ -414,11 +414,11 @@ - + - + @@ -611,11 +611,11 @@ - + - + @@ -656,14 +656,14 @@ - - - - - - - - + + + + + + + + @@ -707,11 +707,11 @@ - + - + @@ -756,14 +756,14 @@ - - - - - - - - + + + + + + + + @@ -804,14 +804,14 @@ - - - - - - - - + + + + + + + + @@ -852,14 +852,14 @@ - - - - - - - - + + + + + + + + @@ -991,11 +991,11 @@ - + - + @@ -1039,11 +1039,11 @@ - + - + @@ -1087,11 +1087,11 @@ - + - + @@ -1135,11 +1135,11 @@ - + - + @@ -1180,14 +1180,14 @@ - - - - - - - - + + + + + + + + @@ -1228,14 +1228,14 @@ - - - - - - - - + + + + + + + + @@ -1389,11 +1389,11 @@ - + - + @@ -1437,11 +1437,11 @@ - + - + @@ -1485,11 +1485,11 @@ - + - + @@ -1533,11 +1533,11 @@ - + - + @@ -1578,14 +1578,14 @@ - - - - - - - - + + + + + + + + @@ -1626,14 +1626,14 @@ - - - - - - - - + + + + + + + + @@ -1677,11 +1677,11 @@ - + - + @@ -1874,11 +1874,11 @@ - + - + @@ -1919,14 +1919,14 @@ - - - - - - - - + + + + + + + + @@ -1970,11 +1970,11 @@ - + - + @@ -2019,14 +2019,14 @@ - - - - - - - - + + + + + + + + @@ -2067,14 +2067,14 @@ - - - - - - - - + + + + + + + + @@ -2115,14 +2115,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml index f0fad5688e..5b50744b8e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window__plan0.xml @@ -126,11 +126,11 @@ - + - + @@ -174,11 +174,11 @@ - + - + @@ -222,11 +222,11 @@ - + - + @@ -270,11 +270,11 @@ - + - + @@ -315,14 +315,14 @@ - - - - - - - - + + + + + + + + @@ -363,14 +363,14 @@ - - - - - - - - + + + + + + + + @@ -414,11 +414,11 @@ - + - + @@ -611,11 +611,11 @@ - + - + @@ -656,14 +656,14 @@ - - - - - - - - + + + + + + + + @@ -707,11 +707,11 @@ - + - + @@ -756,14 +756,14 @@ - - - - - - - - + + + + + + + + @@ -804,14 +804,14 @@ - - - - - - - - + + + + + + + + @@ -852,14 +852,14 @@ - - - - - - - - + + + + + + + + @@ -991,11 +991,11 @@ - + - + @@ -1039,11 +1039,11 @@ - + - + @@ -1087,11 +1087,11 @@ - + - + @@ -1135,11 +1135,11 @@ - + - + @@ -1180,14 +1180,14 @@ - - - - - - - - + + + + + + + + @@ -1228,14 +1228,14 @@ - - - - - - - - + + + + + + + + @@ -1389,11 +1389,11 @@ - + - + @@ -1437,11 +1437,11 @@ - + - + @@ -1485,11 +1485,11 @@ - + - + @@ -1533,11 +1533,11 @@ - + - + @@ -1578,14 +1578,14 @@ - - - - - - - - + + + + + + + + @@ -1626,14 +1626,14 @@ - - - - - - - - + + + + + + + + @@ -1677,11 +1677,11 @@ - + - + @@ -1874,11 +1874,11 @@ - + - + @@ -1919,14 +1919,14 @@ - - - - - - - - + + + + + + + + @@ -1970,11 +1970,11 @@ - + - + @@ -2019,14 +2019,14 @@ - - - - - - - - + + + + + + + + @@ -2067,14 +2067,14 @@ - - - - - - - - + + + + + + + + @@ -2115,14 +2115,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml index df2164f79a..ec4e79d22a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_granularity__plan0.xml @@ -126,11 +126,11 @@ - + - + @@ -174,11 +174,11 @@ - + - + @@ -222,11 +222,11 @@ - + - + @@ -270,11 +270,11 @@ - + - + @@ -315,14 +315,14 @@ - - - - - - - - + + + + + + + + @@ -363,14 +363,14 @@ - - - - - - - - + + + + + + + + @@ -414,11 +414,11 @@ - + - + @@ -611,11 +611,11 @@ - + - + @@ -656,14 +656,14 @@ - - - - - - - - + + + + + + + + @@ -707,11 +707,11 @@ - + - + @@ -756,14 +756,14 @@ - - - - - - - - + + + + + + + + @@ -804,14 +804,14 @@ - - - - - - - - + + + + + + + + @@ -852,14 +852,14 @@ - - - - - - - - + + + + + + + + @@ -991,11 +991,11 @@ - + - + @@ -1039,11 +1039,11 @@ - + - + @@ -1087,11 +1087,11 @@ - + - + @@ -1135,11 +1135,11 @@ - + - + @@ -1180,14 +1180,14 @@ - - - - - - - - + + + + + + + + @@ -1228,14 +1228,14 @@ - - - - - - - - + + + + + + + + @@ -1389,11 +1389,11 @@ - + - + @@ -1437,11 +1437,11 @@ - + - + @@ -1485,11 +1485,11 @@ - + - + @@ -1533,11 +1533,11 @@ - + - + @@ -1578,14 +1578,14 @@ - - - - - - - - + + + + + + + + @@ -1626,14 +1626,14 @@ - - - - - - - - + + + + + + + + @@ -1677,11 +1677,11 @@ - + - + @@ -1874,11 +1874,11 @@ - + - + @@ -1919,14 +1919,14 @@ - - - - - - - - + + + + + + + + @@ -1970,11 +1970,11 @@ - + - + @@ -2019,14 +2019,14 @@ - - - - - - - - + + + + + + + + @@ -2067,14 +2067,14 @@ - - - - - - - - + + + + + + + + @@ -2115,14 +2115,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml index aec16b0428..1014811f94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.xml @@ -130,11 +130,11 @@ - + - + @@ -178,11 +178,11 @@ - + - + @@ -226,11 +226,11 @@ - + - + @@ -274,11 +274,11 @@ - + - + @@ -319,14 +319,14 @@ - - - - - - - - + + + + + + + + @@ -367,14 +367,14 @@ - - - - - - - - + + + + + + + + @@ -528,11 +528,11 @@ - + - + @@ -576,11 +576,11 @@ - + - + @@ -624,11 +624,11 @@ - + - + @@ -672,11 +672,11 @@ - + - + @@ -717,14 +717,14 @@ - - - - - - - - + + + + + + + + @@ -765,14 +765,14 @@ - - - - - - - - + + + + + + + + @@ -816,11 +816,11 @@ - + - + @@ -1013,11 +1013,11 @@ - + - + @@ -1058,14 +1058,14 @@ - - - - - - - - + + + + + + + + @@ -1109,11 +1109,11 @@ - + - + @@ -1158,14 +1158,14 @@ - - - - - - - - + + + + + + + + @@ -1206,14 +1206,14 @@ - - - - - - - - + + + + + + + + @@ -1254,14 +1254,14 @@ - - - - - - - - + + + + + + + + @@ -1394,11 +1394,11 @@ - + - + @@ -1442,11 +1442,11 @@ - + - + @@ -1490,11 +1490,11 @@ - + - + @@ -1538,11 +1538,11 @@ - + - + @@ -1583,14 +1583,14 @@ - - - - - - - - + + + + + + + + @@ -1631,14 +1631,14 @@ - - - - - - - - + + + + + + + + @@ -1792,11 +1792,11 @@ - + - + @@ -1840,11 +1840,11 @@ - + - + @@ -1888,11 +1888,11 @@ - + - + @@ -1936,11 +1936,11 @@ - + - + @@ -1981,14 +1981,14 @@ - - - - - - - - + + + + + + + + @@ -2029,14 +2029,14 @@ - - - - - - - - + + + + + + + + @@ -2080,11 +2080,11 @@ - + - + @@ -2277,11 +2277,11 @@ - + - + @@ -2322,14 +2322,14 @@ - - - - - - - - + + + + + + + + @@ -2373,11 +2373,11 @@ - + - + @@ -2422,14 +2422,14 @@ - - - - - - - - + + + + + + + + @@ -2470,14 +2470,14 @@ - - - - - - - - + + + + + + + + @@ -2518,14 +2518,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml index 600937f011..db25cedbd2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.xml @@ -130,11 +130,11 @@ - + - + @@ -178,11 +178,11 @@ - + - + @@ -226,11 +226,11 @@ - + - + @@ -274,11 +274,11 @@ - + - + @@ -319,14 +319,14 @@ - - - - - - - - + + + + + + + + @@ -367,14 +367,14 @@ - - - - - - - - + + + + + + + + @@ -528,11 +528,11 @@ - + - + @@ -576,11 +576,11 @@ - + - + @@ -624,11 +624,11 @@ - + - + @@ -672,11 +672,11 @@ - + - + @@ -717,14 +717,14 @@ - - - - - - - - + + + + + + + + @@ -765,14 +765,14 @@ - - - - - - - - + + + + + + + + @@ -816,11 +816,11 @@ - + - + @@ -1013,11 +1013,11 @@ - + - + @@ -1058,14 +1058,14 @@ - - - - - - - - + + + + + + + + @@ -1109,11 +1109,11 @@ - + - + @@ -1158,14 +1158,14 @@ - - - - - - - - + + + + + + + + @@ -1206,14 +1206,14 @@ - - - - - - - - + + + + + + + + @@ -1254,14 +1254,14 @@ - - - - - - - - + + + + + + + + @@ -1394,11 +1394,11 @@ - + - + @@ -1442,11 +1442,11 @@ - + - + @@ -1490,11 +1490,11 @@ - + - + @@ -1538,11 +1538,11 @@ - + - + @@ -1583,14 +1583,14 @@ - - - - - - - - + + + + + + + + @@ -1631,14 +1631,14 @@ - - - - - - - - + + + + + + + + @@ -1792,11 +1792,11 @@ - + - + @@ -1840,11 +1840,11 @@ - + - + @@ -1888,11 +1888,11 @@ - + - + @@ -1936,11 +1936,11 @@ - + - + @@ -1981,14 +1981,14 @@ - - - - - - - - + + + + + + + + @@ -2029,14 +2029,14 @@ - - - - - - - - + + + + + + + + @@ -2080,11 +2080,11 @@ - + - + @@ -2277,11 +2277,11 @@ - + - + @@ -2322,14 +2322,14 @@ - - - - - - - - + + + + + + + + @@ -2373,11 +2373,11 @@ - + - + @@ -2422,14 +2422,14 @@ - - - - - - - - + + + + + + + + @@ -2470,14 +2470,14 @@ - - - - - - - - + + + + + + + + @@ -2518,14 +2518,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml index 30d603cdd8..91104c0b88 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_cumulative_metric__plan0.xml @@ -107,11 +107,11 @@ - + - + @@ -155,11 +155,11 @@ - + - + @@ -203,11 +203,11 @@ - + - + @@ -251,11 +251,11 @@ - + - + @@ -296,14 +296,14 @@ - - - - - - - - + + + + + + + + @@ -344,14 +344,14 @@ - - - - - - - - + + + + + + + + @@ -509,11 +509,11 @@ - + - + @@ -557,11 +557,11 @@ - + - + @@ -605,11 +605,11 @@ - + - + @@ -653,11 +653,11 @@ - + - + @@ -698,14 +698,14 @@ - - - - - - - - + + + + + + + + @@ -746,14 +746,14 @@ - - - - - - - - + + + + + + + + @@ -793,11 +793,11 @@ - + - + @@ -951,11 +951,11 @@ - + - + @@ -999,11 +999,11 @@ - + - + @@ -1047,11 +1047,11 @@ - + - + @@ -1095,11 +1095,11 @@ - + - + @@ -1140,14 +1140,14 @@ - - - - - - - - + + + + + + + + @@ -1188,14 +1188,14 @@ - - - - - - - - + + + + + + + + @@ -1239,11 +1239,11 @@ - + - + @@ -1436,11 +1436,11 @@ - + - + @@ -1481,14 +1481,14 @@ - - - - - - - - + + + + + + + + @@ -1532,11 +1532,11 @@ - + - + @@ -1581,14 +1581,14 @@ - - - - - - - - + + + + + + + + @@ -1629,14 +1629,14 @@ - - - - - - - - + + + + + + + + @@ -1677,14 +1677,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml index 3a6e566a97..9ebd2f147b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_derived_offset_metric_with_one_input_metric__plan0.xml @@ -107,11 +107,11 @@ - + - + @@ -155,11 +155,11 @@ - + - + @@ -203,11 +203,11 @@ - + - + @@ -251,11 +251,11 @@ - + - + @@ -296,14 +296,14 @@ - - - - - - - - + + + + + + + + @@ -344,14 +344,14 @@ - - - - - - - - + + + + + + + + @@ -505,11 +505,11 @@ - + - + @@ -553,11 +553,11 @@ - + - + @@ -601,11 +601,11 @@ - + - + @@ -649,11 +649,11 @@ - + - + @@ -694,14 +694,14 @@ - - - - - - - - + + + + + + + + @@ -742,14 +742,14 @@ - - - - - - - - + + + + + + + + @@ -793,11 +793,11 @@ - + - + @@ -990,11 +990,11 @@ - + - + @@ -1035,14 +1035,14 @@ - - - - - - - - + + + + + + + + @@ -1086,11 +1086,11 @@ - + - + @@ -1135,14 +1135,14 @@ - - - - - - - - + + + + + + + + @@ -1183,14 +1183,14 @@ - - - - - - - - + + + + + + + + @@ -1231,14 +1231,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml index b0116367f0..919417183e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_distinct_values__plan0.xml @@ -152,11 +152,11 @@ - + - + @@ -200,11 +200,11 @@ - + - + @@ -248,11 +248,11 @@ - + - + @@ -296,11 +296,11 @@ - + - + @@ -341,14 +341,14 @@ - - - - - - - - + + + + + + + + @@ -389,14 +389,14 @@ - - - - - - - - + + + + + + + + @@ -440,11 +440,11 @@ - + - + @@ -637,11 +637,11 @@ - + - + @@ -682,14 +682,14 @@ - - - - - - - - + + + + + + + + @@ -733,11 +733,11 @@ - + - + @@ -782,14 +782,14 @@ - - - - - - - - + + + + + + + + @@ -830,14 +830,14 @@ - - - - - - - - + + + + + + + + @@ -878,14 +878,14 @@ - - - - - - - - + + + + + + + + @@ -981,11 +981,11 @@ - + - + @@ -1029,11 +1029,11 @@ - + - + @@ -1077,11 +1077,11 @@ - + - + @@ -1122,14 +1122,14 @@ - - - - - - - - + + + + + + + + @@ -1173,11 +1173,11 @@ - + - + @@ -1286,11 +1286,11 @@ - + - + @@ -1331,14 +1331,14 @@ - - - - - - - - + + + + + + + + @@ -1391,14 +1391,14 @@ - - - - - - - - + + + + + + + + @@ -1439,14 +1439,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml index fcfe3e55b0..aba5cdf553 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_node__plan0.xml @@ -116,11 +116,11 @@ - + - + @@ -161,14 +161,14 @@ - - - - - - - - + + + + + + + + @@ -212,11 +212,11 @@ - + - + @@ -261,14 +261,14 @@ - - - - - - - - + + + + + + + + @@ -309,14 +309,14 @@ - - - - - - - - + + + + + + + + @@ -357,14 +357,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml index 3588eccfef..81fcf21f1b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_node__plan0.xml @@ -134,11 +134,11 @@ - + - + @@ -179,14 +179,14 @@ - - - - - - - - + + + + + + + + @@ -230,11 +230,11 @@ - + - + @@ -279,14 +279,14 @@ - - - - - - - - + + + + + + + + @@ -327,14 +327,14 @@ - - - - - - - - + + + + + + + + @@ -375,14 +375,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml index a809f0c726..ea3ee863e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_filter_with_where_constraint_on_join_dim__plan0.xml @@ -173,11 +173,11 @@ - + - + @@ -221,11 +221,11 @@ - + - + @@ -269,11 +269,11 @@ - + - + @@ -317,11 +317,11 @@ - + - + @@ -362,14 +362,14 @@ - - - - - - - - + + + + + + + + @@ -410,14 +410,14 @@ - - - - - - - - + + + + + + + + @@ -461,11 +461,11 @@ - + - + @@ -658,11 +658,11 @@ - + - + @@ -703,14 +703,14 @@ - - - - - - - - + + + + + + + + @@ -754,11 +754,11 @@ - + - + @@ -803,14 +803,14 @@ - - - - - - - - + + + + + + + + @@ -851,14 +851,14 @@ - - - - - - - - + + + + + + + + @@ -899,14 +899,14 @@ - - - - - - - - + + + + + + + + @@ -1002,11 +1002,11 @@ - + - + @@ -1050,11 +1050,11 @@ - + - + @@ -1098,11 +1098,11 @@ - + - + @@ -1143,14 +1143,14 @@ - - - - - - - - + + + + + + + + @@ -1194,11 +1194,11 @@ - + - + @@ -1307,11 +1307,11 @@ - + - + @@ -1352,14 +1352,14 @@ - - - - - - - - + + + + + + + + @@ -1412,14 +1412,14 @@ - - - - - - - - + + + + + + + + @@ -1460,14 +1460,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml index 9cc83dfb26..79159f5015 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_scd_dimension__plan0.xml @@ -181,11 +181,11 @@ - + - + @@ -229,11 +229,11 @@ - + - + @@ -277,11 +277,11 @@ - + - + @@ -325,11 +325,11 @@ - + - + @@ -370,14 +370,14 @@ - - - - - - - - + + + + + + + + @@ -418,14 +418,14 @@ - - - - - - - - + + + + + + + + @@ -469,11 +469,11 @@ - + - + @@ -610,11 +610,11 @@ - + - + @@ -655,14 +655,14 @@ - - - - - - - - + + + + + + + + @@ -706,11 +706,11 @@ - + - + @@ -755,14 +755,14 @@ - - - - - - - - + + + + + + + + @@ -803,14 +803,14 @@ - - - - - - - - + + + + + + + + @@ -851,14 +851,14 @@ - - - - - - - - + + + + + + + + @@ -967,14 +967,14 @@ - - - - - - - - + + + + + + + + @@ -1015,14 +1015,14 @@ - - - - - - - - + + + + + + + + @@ -1075,14 +1075,14 @@ - - - - - - - - + + + + + + + + @@ -1123,14 +1123,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml index deb1256c84..6c3d99f0d6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_to_grain__plan0.xml @@ -144,11 +144,11 @@ - + - + @@ -192,11 +192,11 @@ - + - + @@ -240,11 +240,11 @@ - + - + @@ -288,11 +288,11 @@ - + - + @@ -333,14 +333,14 @@ - - - - - - - - + + + + + + + + @@ -381,14 +381,14 @@ - - - - - - - - + + + + + + + + @@ -432,11 +432,11 @@ - + - + @@ -629,11 +629,11 @@ - + - + @@ -674,14 +674,14 @@ - - - - - - - - + + + + + + + + @@ -725,11 +725,11 @@ - + - + @@ -774,14 +774,14 @@ - - - - - - - - + + + + + + + + @@ -822,14 +822,14 @@ - - - - - - - - + + + + + + + + @@ -870,14 +870,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml index deb1256c84..6c3d99f0d6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_with_offset_window__plan0.xml @@ -144,11 +144,11 @@ - + - + @@ -192,11 +192,11 @@ - + - + @@ -240,11 +240,11 @@ - + - + @@ -288,11 +288,11 @@ - + - + @@ -333,14 +333,14 @@ - - - - - - - - + + + + + + + + @@ -381,14 +381,14 @@ - - - - - - - - + + + + + + + + @@ -432,11 +432,11 @@ - + - + @@ -629,11 +629,11 @@ - + - + @@ -674,14 +674,14 @@ - - - - - - - - + + + + + + + + @@ -725,11 +725,11 @@ - + - + @@ -774,14 +774,14 @@ - - - - - - - - + + + + + + + + @@ -822,14 +822,14 @@ - - - - - - - - + + + + + + + + @@ -870,14 +870,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml index deb1256c84..6c3d99f0d6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_join_to_time_spine_node_without_offset__plan0.xml @@ -144,11 +144,11 @@ - + - + @@ -192,11 +192,11 @@ - + - + @@ -240,11 +240,11 @@ - + - + @@ -288,11 +288,11 @@ - + - + @@ -333,14 +333,14 @@ - - - - - - - - + + + + + + + + @@ -381,14 +381,14 @@ - - - - - - - - + + + + + + + + @@ -432,11 +432,11 @@ - + - + @@ -629,11 +629,11 @@ - + - + @@ -674,14 +674,14 @@ - - - - - - - - + + + + + + + + @@ -725,11 +725,11 @@ - + - + @@ -774,14 +774,14 @@ - - - - - - - - + + + + + + + + @@ -822,14 +822,14 @@ - - - - - - - - + + + + + + + + @@ -870,14 +870,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml index 0c0b947455..af7fd91535 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_limit_rows__plan0.xml @@ -103,11 +103,11 @@ - + - + @@ -151,11 +151,11 @@ - + - + @@ -199,11 +199,11 @@ - + - + @@ -247,11 +247,11 @@ - + - + @@ -292,14 +292,14 @@ - - - - - - - - + + + + + + + + @@ -340,14 +340,14 @@ - - - - - - - - + + + + + + + + @@ -391,11 +391,11 @@ - + - + @@ -588,11 +588,11 @@ - + - + @@ -633,14 +633,14 @@ - - - - - - - - + + + + + + + + @@ -684,11 +684,11 @@ - + - + @@ -733,14 +733,14 @@ - - - - - - - - + + + + + + + + @@ -781,14 +781,14 @@ - - - - - - - - + + + + + + + + @@ -829,14 +829,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml index 90cd7de9ba..e0c553b7cb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_local_dimension_using_local_entity__plan0.xml @@ -90,11 +90,11 @@ - + - + @@ -138,11 +138,11 @@ - + - + @@ -186,11 +186,11 @@ - + - + @@ -231,14 +231,14 @@ - - - - - - - - + + + + + + + + @@ -282,11 +282,11 @@ - + - + @@ -395,11 +395,11 @@ - + - + @@ -440,14 +440,14 @@ - - - - - - - - + + + + + + + + @@ -500,14 +500,14 @@ - - - - - - - - + + + + + + + + @@ -548,14 +548,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml index aa58e56a77..9927bd6230 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_aggregation_node__plan0.xml @@ -149,11 +149,11 @@ - + - + @@ -194,14 +194,14 @@ - - - - - - - - + + + + + + + + @@ -245,11 +245,11 @@ - + - + @@ -294,14 +294,14 @@ - - - - - - - - + + + + + + + + @@ -342,14 +342,14 @@ - - - - - - - - + + + + + + + + @@ -390,14 +390,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml index 2d8e684ff8..1b93709a92 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint__plan0.xml @@ -219,11 +219,11 @@ - + - + @@ -267,11 +267,11 @@ - + - + @@ -315,11 +315,11 @@ - + - + @@ -363,11 +363,11 @@ - + - + @@ -408,14 +408,14 @@ - - - - - - - - + + + + + + + + @@ -456,14 +456,14 @@ - - - - - - - - + + + + + + + + @@ -507,11 +507,11 @@ - + - + @@ -704,11 +704,11 @@ - + - + @@ -749,14 +749,14 @@ - - - - - - - - + + + + + + + + @@ -800,11 +800,11 @@ - + - + @@ -849,14 +849,14 @@ - - - - - - - - + + + + + + + + @@ -897,14 +897,14 @@ - - - - - - - - + + + + + + + + @@ -945,14 +945,14 @@ - - - - - - - - + + + + + + + + @@ -1048,11 +1048,11 @@ - + - + @@ -1096,11 +1096,11 @@ - + - + @@ -1144,11 +1144,11 @@ - + - + @@ -1189,14 +1189,14 @@ - - - - - - - - + + + + + + + + @@ -1240,11 +1240,11 @@ - + - + @@ -1353,11 +1353,11 @@ - + - + @@ -1398,14 +1398,14 @@ - - - - - - - - + + + + + + + + @@ -1458,14 +1458,14 @@ - - - - - - - - + + + + + + + + @@ -1506,14 +1506,14 @@ - - - - - - - - + + + + + + + + @@ -1728,11 +1728,11 @@ - + - + @@ -1776,11 +1776,11 @@ - + - + @@ -1824,11 +1824,11 @@ - + - + @@ -1872,11 +1872,11 @@ - + - + @@ -1917,14 +1917,14 @@ - - - - - - - - + + + + + + + + @@ -1965,14 +1965,14 @@ - - - - - - - - + + + + + + + + @@ -2016,11 +2016,11 @@ - + - + @@ -2213,11 +2213,11 @@ - + - + @@ -2258,14 +2258,14 @@ - - - - - - - - + + + + + + + + @@ -2309,11 +2309,11 @@ - + - + @@ -2358,14 +2358,14 @@ - - - - - - - - + + + + + + + + @@ -2406,14 +2406,14 @@ - - - - - - - - + + + + + + + + @@ -2454,14 +2454,14 @@ - - - - - - - - + + + + + + + + @@ -2557,11 +2557,11 @@ - + - + @@ -2605,11 +2605,11 @@ - + - + @@ -2653,11 +2653,11 @@ - + - + @@ -2698,14 +2698,14 @@ - - - - - - - - + + + + + + + + @@ -2749,11 +2749,11 @@ - + - + @@ -2862,11 +2862,11 @@ - + - + @@ -2907,14 +2907,14 @@ - - - - - - - - + + + + + + + + @@ -2967,14 +2967,14 @@ - - - - - - - - + + + + + + + + @@ -3015,14 +3015,14 @@ - - - - - - - - + + + + + + + + @@ -3154,11 +3154,11 @@ - + - + @@ -3202,11 +3202,11 @@ - + - + @@ -3250,11 +3250,11 @@ - + - + @@ -3298,11 +3298,11 @@ - + - + @@ -3343,14 +3343,14 @@ - - - - - - - - + + + + + + + + @@ -3391,14 +3391,14 @@ - - - - - - - - + + + + + + + + @@ -3442,11 +3442,11 @@ - + - + @@ -3639,11 +3639,11 @@ - + - + @@ -3684,14 +3684,14 @@ - - - - - - - - + + + + + + + + @@ -3735,11 +3735,11 @@ - + - + @@ -3784,14 +3784,14 @@ - - - - - - - - + + + + + + + + @@ -3832,14 +3832,14 @@ - - - - - - - - + + + + + + + + @@ -3880,14 +3880,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml index abe224335b..f3d68efd51 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_reused_measure__plan0.xml @@ -163,11 +163,11 @@ - + - + @@ -211,11 +211,11 @@ - + - + @@ -259,11 +259,11 @@ - + - + @@ -307,11 +307,11 @@ - + - + @@ -352,14 +352,14 @@ - - - - - - - - + + + + + + + + @@ -400,14 +400,14 @@ - - - - - - - - + + + + + + + + @@ -451,11 +451,11 @@ - + - + @@ -648,11 +648,11 @@ - + - + @@ -693,14 +693,14 @@ - - - - - - - - + + + + + + + + @@ -744,11 +744,11 @@ - + - + @@ -793,14 +793,14 @@ - - - - - - - - + + + + + + + + @@ -841,14 +841,14 @@ - - - - - - - - + + + + + + + + @@ -889,14 +889,14 @@ - - - - - - - - + + + + + + + + @@ -1026,11 +1026,11 @@ - + - + @@ -1074,11 +1074,11 @@ - + - + @@ -1122,11 +1122,11 @@ - + - + @@ -1170,11 +1170,11 @@ - + - + @@ -1215,14 +1215,14 @@ - - - - - - - - + + + + + + + + @@ -1263,14 +1263,14 @@ - - - - - - - - + + + + + + + + @@ -1314,11 +1314,11 @@ - + - + @@ -1511,11 +1511,11 @@ - + - + @@ -1556,14 +1556,14 @@ - - - - - - - - + + + + + + + + @@ -1607,11 +1607,11 @@ - + - + @@ -1656,14 +1656,14 @@ - - - - - - - - + + + + + + + + @@ -1704,14 +1704,14 @@ - - - - - - - - + + + + + + + + @@ -1752,14 +1752,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml index 05c1e14185..7380884768 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_measure_constraint_with_single_expr_and_alias__plan0.xml @@ -140,11 +140,11 @@ - + - + @@ -188,11 +188,11 @@ - + - + @@ -236,11 +236,11 @@ - + - + @@ -284,11 +284,11 @@ - + - + @@ -329,14 +329,14 @@ - - - - - - - - + + + + + + + + @@ -377,14 +377,14 @@ - - - - - - - - + + + + + + + + @@ -428,11 +428,11 @@ - + - + @@ -625,11 +625,11 @@ - + - + @@ -670,14 +670,14 @@ - - - - - - - - + + + + + + + + @@ -721,11 +721,11 @@ - + - + @@ -770,14 +770,14 @@ - - - - - - - - + + + + + + + + @@ -818,14 +818,14 @@ - - - - - - - - + + + + + + + + @@ -866,14 +866,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml index ea838d4c06..7b5ea95fa3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.xml @@ -102,11 +102,11 @@ - + - + @@ -150,11 +150,11 @@ - + - + @@ -198,11 +198,11 @@ - + - + @@ -246,11 +246,11 @@ - + - + @@ -291,14 +291,14 @@ - - - - - - - - + + + + + + + + @@ -339,14 +339,14 @@ - - - - - - - - + + + + + + + + @@ -390,11 +390,11 @@ - + - + @@ -587,11 +587,11 @@ - + - + @@ -632,14 +632,14 @@ - - - - - - - - + + + + + + + + @@ -683,11 +683,11 @@ - + - + @@ -732,14 +732,14 @@ - - - - - - - - + + + + + + + + @@ -780,14 +780,14 @@ - - - - - - - - + + + + + + + + @@ -828,14 +828,14 @@ - - - - - - - - + + + + + + + + @@ -947,11 +947,11 @@ - + - + @@ -995,11 +995,11 @@ - + - + @@ -1043,11 +1043,11 @@ - + - + @@ -1088,14 +1088,14 @@ - - - - - - - - + + + + + + + + @@ -1139,11 +1139,11 @@ - + - + @@ -1252,11 +1252,11 @@ - + - + @@ -1297,14 +1297,14 @@ - - - - - - - - + + + + + + + + @@ -1357,14 +1357,14 @@ - - - - - - - - + + + + + + + + @@ -1405,14 +1405,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml index 0f3e05153d..63e2148484 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml @@ -160,11 +160,11 @@ - + - + @@ -208,11 +208,11 @@ - + - + @@ -256,11 +256,11 @@ - + - + @@ -304,11 +304,11 @@ - + - + @@ -349,14 +349,14 @@ - - - - - - - - + + + + + + + + @@ -397,14 +397,14 @@ - - - - - - - - + + + + + + + + @@ -448,11 +448,11 @@ - + - + @@ -589,11 +589,11 @@ - + - + @@ -634,14 +634,14 @@ - - - - - - - - + + + + + + + + @@ -685,11 +685,11 @@ - + - + @@ -734,14 +734,14 @@ - - - - - - - - + + + + + + + + @@ -782,14 +782,14 @@ - - - - - - - - + + + + + + + + @@ -830,14 +830,14 @@ - - - - - - - - + + + + + + + + @@ -949,11 +949,11 @@ - + - + @@ -997,11 +997,11 @@ - + - + @@ -1042,14 +1042,14 @@ - - - - - - - - + + + + + + + + @@ -1090,14 +1090,14 @@ - - - - - - - - + + + + + + + + @@ -1141,11 +1141,11 @@ - + - + @@ -1237,14 +1237,14 @@ - - - - - - - - + + + + + + + + @@ -1285,14 +1285,14 @@ - - - - - - - - + + + + + + + + @@ -1345,14 +1345,14 @@ - - - - - - - - + + + + + + + + @@ -1393,14 +1393,14 @@ - - - - - - - - + + + + + + + + @@ -1507,11 +1507,11 @@ - + - + @@ -1555,11 +1555,11 @@ - + - + @@ -1620,11 +1620,11 @@ - + - + @@ -1672,11 +1672,11 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml index d506931ba5..a013e8d8c1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml @@ -160,11 +160,11 @@ - + - + @@ -208,11 +208,11 @@ - + - + @@ -256,11 +256,11 @@ - + - + @@ -304,11 +304,11 @@ - + - + @@ -349,14 +349,14 @@ - - - - - - - - + + + + + + + + @@ -397,14 +397,14 @@ - - - - - - - - + + + + + + + + @@ -448,11 +448,11 @@ - + - + @@ -589,11 +589,11 @@ - + - + @@ -634,14 +634,14 @@ - - - - - - - - + + + + + + + + @@ -685,11 +685,11 @@ - + - + @@ -734,14 +734,14 @@ - - - - - - - - + + + + + + + + @@ -782,14 +782,14 @@ - - - - - - - - + + + + + + + + @@ -830,14 +830,14 @@ - - - - - - - - + + + + + + + + @@ -949,14 +949,14 @@ - - - - - - - - + + + + + + + + @@ -997,14 +997,14 @@ - - - - - - - - + + + + + + + + @@ -1151,11 +1151,11 @@ - + - + @@ -1199,11 +1199,11 @@ - + - + @@ -1244,14 +1244,14 @@ - - - - - - - - + + + + + + + + @@ -1292,14 +1292,14 @@ - - - - - - - - + + + + + + + + @@ -1357,14 +1357,14 @@ - - - - - - - - + + + + + + + + @@ -1405,14 +1405,14 @@ - - - - - - - - + + + + + + + + @@ -1457,14 +1457,14 @@ - - - - - - - - + + + + + + + + @@ -1505,14 +1505,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml index 86c66d0258..5fc98dd938 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_join_node__plan0.xml @@ -153,11 +153,11 @@ - + - + @@ -198,14 +198,14 @@ - - - - - - - - + + + + + + + + @@ -249,11 +249,11 @@ - + - + @@ -298,14 +298,14 @@ - - - - - - - - + + + + + + + + @@ -346,14 +346,14 @@ - - - - - - - - + + + + + + + + @@ -394,14 +394,14 @@ - - - - - - - - + + + + + + + + @@ -508,11 +508,11 @@ - + - + @@ -553,14 +553,14 @@ - - - - - - - - + + + + + + + + @@ -613,14 +613,14 @@ - - - - - - - - + + + + + + + + @@ -661,14 +661,14 @@ - - - - - - - - + + + + + + + + @@ -775,11 +775,11 @@ - + - + @@ -820,14 +820,14 @@ - - - - - - - - + + + + + + + + @@ -880,14 +880,14 @@ - - - - - - - - + + + + + + + + @@ -928,14 +928,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml index 8646094e2a..4a1df37c68 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml @@ -140,11 +140,11 @@ - + - + @@ -188,11 +188,11 @@ - + - + @@ -233,14 +233,14 @@ - - - - - - - - + + + + + + + + @@ -284,11 +284,11 @@ - + - + @@ -332,11 +332,11 @@ - + - + @@ -402,14 +402,14 @@ - - - - - - - - + + + + + + + + @@ -453,11 +453,11 @@ - + - + @@ -502,14 +502,14 @@ - - - - - - - - + + + + + + + + @@ -550,14 +550,14 @@ - - - - - - - - + + + + + + + + @@ -641,11 +641,11 @@ - + - + @@ -686,14 +686,14 @@ - - - - - - - - + + + + + + + + @@ -734,14 +734,14 @@ - - - - - - - - + + + + + + + + @@ -825,14 +825,14 @@ - - - - - - - - + + + + + + + + @@ -877,14 +877,14 @@ - - - - - - - - + + + + + + + + @@ -981,11 +981,11 @@ - + - + @@ -1026,14 +1026,14 @@ - - - - - - - - + + + + + + + + @@ -1107,14 +1107,14 @@ - - - - - - - - + + + + + + + + @@ -1163,14 +1163,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml index 91382c7f6c..3ad305b7ab 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multiple_metrics_no_dimensions__plan0.xml @@ -94,11 +94,11 @@ - + - + @@ -142,11 +142,11 @@ - + - + @@ -190,11 +190,11 @@ - + - + @@ -238,11 +238,11 @@ - + - + @@ -283,14 +283,14 @@ - - - - - - - - + + + + + + + + @@ -334,11 +334,11 @@ - + - + @@ -382,11 +382,11 @@ - + - + @@ -519,11 +519,11 @@ - + - + @@ -567,11 +567,11 @@ - + - + @@ -615,11 +615,11 @@ - + - + @@ -663,11 +663,11 @@ - + - + @@ -708,14 +708,14 @@ - - - - - - - - + + + + + + + + @@ -756,14 +756,14 @@ - - - - - - - - + + + + + + + + @@ -807,11 +807,11 @@ - + - + @@ -1004,11 +1004,11 @@ - + - + @@ -1049,14 +1049,14 @@ - - - - - - - - + + + + + + + + @@ -1100,11 +1100,11 @@ - + - + @@ -1149,14 +1149,14 @@ - - - - - - - - + + + + + + + + @@ -1197,14 +1197,14 @@ - - - - - - - - + + + + + + + + @@ -1245,14 +1245,14 @@ - - - - - - - - + + + + + + + + @@ -1366,11 +1366,11 @@ - + - + @@ -1414,11 +1414,11 @@ - + - + @@ -1462,11 +1462,11 @@ - + - + @@ -1507,14 +1507,14 @@ - - - - - - - - + + + + + + + + @@ -1558,11 +1558,11 @@ - + - + @@ -1659,11 +1659,11 @@ - + - + @@ -1707,11 +1707,11 @@ - + - + @@ -1755,11 +1755,11 @@ - + - + @@ -1800,14 +1800,14 @@ - - - - - - - - + + + + + + + + @@ -1851,11 +1851,11 @@ - + - + @@ -1964,11 +1964,11 @@ - + - + @@ -2009,14 +2009,14 @@ - - - - - - - - + + + + + + + + @@ -2069,14 +2069,14 @@ - - - - - - - - + + + + + + + + @@ -2117,14 +2117,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml index dbf66e4cac..5a9299184c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_nested_derived_metric__plan0.xml @@ -172,11 +172,11 @@ - + - + @@ -220,11 +220,11 @@ - + - + @@ -268,11 +268,11 @@ - + - + @@ -316,11 +316,11 @@ - + - + @@ -361,14 +361,14 @@ - - - - - - - - + + + + + + + + @@ -409,14 +409,14 @@ - - - - - - - - + + + + + + + + @@ -460,11 +460,11 @@ - + - + @@ -657,11 +657,11 @@ - + - + @@ -702,14 +702,14 @@ - - - - - - - - + + + + + + + + @@ -753,11 +753,11 @@ - + - + @@ -802,14 +802,14 @@ - - - - - - - - + + + + + + + + @@ -850,14 +850,14 @@ - - - - - - - - + + + + + + + + @@ -898,14 +898,14 @@ - - - - - - - - + + + + + + + + @@ -1033,11 +1033,11 @@ - + - + @@ -1081,11 +1081,11 @@ - + - + @@ -1129,11 +1129,11 @@ - + - + @@ -1177,11 +1177,11 @@ - + - + @@ -1222,14 +1222,14 @@ - - - - - - - - + + + + + + + + @@ -1270,14 +1270,14 @@ - - - - - - - - + + + + + + + + @@ -1321,11 +1321,11 @@ - + - + @@ -1518,11 +1518,11 @@ - + - + @@ -1563,14 +1563,14 @@ - - - - - - - - + + + + + + + + @@ -1614,11 +1614,11 @@ - + - + @@ -1663,14 +1663,14 @@ - - - - - - - - + + + + + + + + @@ -1711,14 +1711,14 @@ - - - - - - - - + + + + + + + + @@ -1759,14 +1759,14 @@ - - - - - - - - + + + + + + + + @@ -1896,11 +1896,11 @@ - + - + @@ -1944,11 +1944,11 @@ - + - + @@ -1992,11 +1992,11 @@ - + - + @@ -2040,11 +2040,11 @@ - + - + @@ -2085,14 +2085,14 @@ - - - - - - - - + + + + + + + + @@ -2133,14 +2133,14 @@ - - - - - - - - + + + + + + + + @@ -2184,11 +2184,11 @@ - + - + @@ -2381,11 +2381,11 @@ - + - + @@ -2426,14 +2426,14 @@ - - - - - - - - + + + + + + + + @@ -2477,11 +2477,11 @@ - + - + @@ -2526,14 +2526,14 @@ - - - - - - - - + + + + + + + + @@ -2574,14 +2574,14 @@ - - - - - - - - + + + + + + + + @@ -2622,14 +2622,14 @@ - - - - - - - - + + + + + + + + @@ -2757,11 +2757,11 @@ - + - + @@ -2805,11 +2805,11 @@ - + - + @@ -2853,11 +2853,11 @@ - + - + @@ -2901,11 +2901,11 @@ - + - + @@ -2946,14 +2946,14 @@ - - - - - - - - + + + + + + + + @@ -2994,14 +2994,14 @@ - - - - - - - - + + + + + + + + @@ -3045,11 +3045,11 @@ - + - + @@ -3242,11 +3242,11 @@ - + - + @@ -3287,14 +3287,14 @@ - - - - - - - - + + + + + + + + @@ -3338,11 +3338,11 @@ - + - + @@ -3387,14 +3387,14 @@ - - - - - - - - + + + + + + + + @@ -3435,14 +3435,14 @@ - - - - - - - - + + + + + + + + @@ -3483,14 +3483,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml index dd1374fbd4..0069ee8ee7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_order_by_node__plan0.xml @@ -191,11 +191,11 @@ - + - + @@ -236,14 +236,14 @@ - - - - - - - - + + + + + + + + @@ -287,11 +287,11 @@ - + - + @@ -336,14 +336,14 @@ - - - - - - - - + + + + + + + + @@ -384,14 +384,14 @@ - - - - - - - - + + + + + + + + @@ -432,14 +432,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml index 8b5700c40e..6fbc2644c7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_partitioned_join__plan0.xml @@ -140,11 +140,11 @@ - + - + @@ -188,11 +188,11 @@ - + - + @@ -233,14 +233,14 @@ - - - - - - - - + + + + + + + + @@ -281,14 +281,14 @@ - - - - - - - - + + + + + + + + @@ -332,11 +332,11 @@ - + - + @@ -413,11 +413,11 @@ - + - + @@ -458,14 +458,14 @@ - - - - - - - - + + + + + + + + @@ -510,14 +510,14 @@ - - - - - - - - + + + + + + + + @@ -558,14 +558,14 @@ - - - - - - - - + + + + + + + + @@ -657,11 +657,11 @@ - + - + @@ -702,14 +702,14 @@ - - - - - - - - + + + + + + + + @@ -750,14 +750,14 @@ - - - - - - - - + + + + + + + + @@ -805,11 +805,11 @@ - + - + @@ -850,14 +850,14 @@ - - - - - - - - + + + + + + + + @@ -898,14 +898,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml index 132ec029e6..f6a1229769 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node__plan0.xml @@ -45,11 +45,11 @@ - + - + @@ -93,11 +93,11 @@ - + - + @@ -192,11 +192,11 @@ - + - + @@ -241,14 +241,14 @@ - - - - - - - - + + + + + + + + @@ -336,11 +336,11 @@ - + - + @@ -385,14 +385,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml index cceeec487f..f8ed520f2f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_grouping__plan0.xml @@ -45,11 +45,11 @@ - + - + @@ -93,11 +93,11 @@ - + - + @@ -192,11 +192,11 @@ - + - + @@ -241,14 +241,14 @@ - - - - - - - - + + + + + + + + @@ -344,11 +344,11 @@ - + - + @@ -393,14 +393,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml index f030246e44..ed70382110 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_semi_additive_join_node_with_queried_group_by__plan0.xml @@ -45,11 +45,11 @@ - + - + @@ -93,11 +93,11 @@ - + - + @@ -192,11 +192,11 @@ - + - + @@ -241,14 +241,14 @@ - - - - - - - - + + + + + + + + @@ -344,11 +344,11 @@ - + - + @@ -393,14 +393,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml index e1cc885427..d6e800bd30 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_single_join_node__plan0.xml @@ -139,11 +139,11 @@ - + - + @@ -184,14 +184,14 @@ - - - - - - - - + + + + + + + + @@ -235,11 +235,11 @@ - + - + @@ -284,14 +284,14 @@ - - - - - - - - + + + + + + + + @@ -332,14 +332,14 @@ - - - - - - - - + + + + + + + + @@ -380,14 +380,14 @@ - - - - - - - - + + + + + + + + @@ -494,11 +494,11 @@ - + - + @@ -539,14 +539,14 @@ - - - - - - - - + + + + + + + + @@ -599,14 +599,14 @@ - - - - - - - - + + + + + + + + @@ -647,14 +647,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml index c497bc5f85..75df770af7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_source_node__plan0.xml @@ -105,11 +105,11 @@ - + - + @@ -150,14 +150,14 @@ - - - - - - - - + + + + + + + + @@ -201,11 +201,11 @@ - + - + @@ -250,14 +250,14 @@ - - - - - - - - + + + + + + + + @@ -298,14 +298,14 @@ - - - - - - - - + + + + + + + + @@ -346,14 +346,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index b9c1d34bad..c1a2ea132e 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.paid_at__extract_month AS metric_time__extract_month , subq_0.paid_at__extract_week AS metric_time__extract_week , subq_0.paid_at__extract_day AS metric_time__extract_day - , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.paid_at__extract_dow AS metric_time__extract_dow + , subq_0.paid_at__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -121,8 +121,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -133,8 +133,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -145,8 +145,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -158,8 +158,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -170,8 +170,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -182,8 +182,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 9326cd820a..5b9d645f22 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -11,8 +11,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS ds__extract_month , EXTRACT(WEEK FROM ds) AS ds__extract_week , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month @@ -23,8 +23,8 @@ SELECT , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month @@ -35,8 +35,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month @@ -47,8 +47,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month @@ -59,8 +59,8 @@ SELECT , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month @@ -71,8 +71,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month @@ -83,8 +83,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index a2a9795f0c..e5d56619ca 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -133,8 +133,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -145,8 +145,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -157,8 +157,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -170,8 +170,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 30a42573dd..72985c569e 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -11,8 +11,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS ds__extract_month , EXTRACT(WEEK FROM ds) AS ds__extract_week , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month @@ -23,8 +23,8 @@ SELECT , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month @@ -35,8 +35,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month @@ -47,8 +47,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month @@ -59,8 +59,8 @@ SELECT , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month @@ -71,8 +71,8 @@ SELECT , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month @@ -83,8 +83,8 @@ SELECT , EXTRACT(MONTH FROM ds) AS metric_time__extract_month , EXTRACT(WEEK FROM ds) AS metric_time__extract_week , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql index 4b399298d5..08c1707601 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,8 +155,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -167,8 +167,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -179,8 +179,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -192,8 +192,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -204,8 +204,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -216,8 +216,8 @@ FROM ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month AS metric_time__extract_month , subq_5.paid_at__extract_week AS metric_time__extract_week , subq_5.paid_at__extract_day AS metric_time__extract_day - , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.paid_at__extract_dow AS metric_time__extract_dow + , subq_5.paid_at__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -372,8 +372,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month @@ -384,8 +384,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month @@ -396,8 +396,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week @@ -409,8 +409,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month @@ -433,8 +433,8 @@ FULL OUTER JOIN ( , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml index b7325320f3..84429ca4f1 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.xml @@ -45,11 +45,11 @@ - + - + @@ -93,11 +93,11 @@ - + - + @@ -141,11 +141,11 @@ - + - + @@ -189,11 +189,11 @@ - + - + @@ -234,14 +234,14 @@ - - - - - - - - + + + + + + + + @@ -282,14 +282,14 @@ - - - - - - - - + + + + + + + + @@ -333,11 +333,11 @@ - + - + @@ -482,11 +482,11 @@ - + - + @@ -527,14 +527,14 @@ - - - - - - - - + + + + + + + + @@ -578,11 +578,11 @@ - + - + @@ -627,14 +627,14 @@ - - - - - - - - + + + + + + + + @@ -675,14 +675,14 @@ - - - - - - - - + + + + + + + + @@ -723,14 +723,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml index bedd5ead3d..f20c045afe 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_metric_time_dimension_transform_node_using_primary_time__plan0.xml @@ -45,11 +45,11 @@ - + - + @@ -93,11 +93,11 @@ - + - + @@ -141,11 +141,11 @@ - + - + @@ -189,11 +189,11 @@ - + - + @@ -234,14 +234,14 @@ - - - - - - - - + + + + + + + + @@ -282,14 +282,14 @@ - - - - - - - - + + + + + + + + @@ -333,11 +333,11 @@ - + - + @@ -530,11 +530,11 @@ - + - + @@ -575,14 +575,14 @@ - - - - - - - - + + + + + + + + @@ -626,11 +626,11 @@ - + - + @@ -675,14 +675,14 @@ - - - - - - - - + + + + + + + + @@ -723,14 +723,14 @@ - - - - - - - - + + + + + + + + @@ -771,14 +771,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml index be05efe8ce..66d7813741 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/test_simple_query_with_metric_time_dimension__plan0.xml @@ -117,11 +117,11 @@ - + - + @@ -165,11 +165,11 @@ - + - + @@ -213,11 +213,11 @@ - + - + @@ -261,11 +261,11 @@ - + - + @@ -306,14 +306,14 @@ - - - - - - - - + + + + + + + + @@ -354,14 +354,14 @@ - - - - - - - - + + + + + + + + @@ -405,11 +405,11 @@ - + - + @@ -602,11 +602,11 @@ - + - + @@ -647,14 +647,14 @@ - - - - - - - - + + + + + + + + @@ -698,11 +698,11 @@ - + - + @@ -747,14 +747,14 @@ - - - - - - - - + + + + + + + + @@ -795,14 +795,14 @@ - - - - - - - - + + + + + + + + @@ -843,14 +843,14 @@ - - - - - - - - + + + + + + + + @@ -978,11 +978,11 @@ - + - + @@ -1026,11 +1026,11 @@ - + - + @@ -1074,11 +1074,11 @@ - + - + @@ -1122,11 +1122,11 @@ - + - + @@ -1167,14 +1167,14 @@ - - - - - - - - + + + + + + + + @@ -1215,14 +1215,14 @@ - - - - - - - - + + + + + + + + @@ -1266,11 +1266,11 @@ - + - + @@ -1415,11 +1415,11 @@ - + - + @@ -1460,14 +1460,14 @@ - - - - - - - - + + + + + + + + @@ -1511,11 +1511,11 @@ - + - + @@ -1560,14 +1560,14 @@ - - - - - - - - + + + + + + + + @@ -1608,14 +1608,14 @@ - - - - - - - - + + + + + + + + @@ -1656,14 +1656,14 @@ - - - - - - - - + + + + + + + + diff --git a/metricflow/time/date_part.py b/metricflow/time/date_part.py index b6ccea9172..cccb1be6c8 100644 --- a/metricflow/time/date_part.py +++ b/metricflow/time/date_part.py @@ -17,8 +17,8 @@ class DatePart(Enum): MONTH = "month" WEEK = "week" DAY = "day" - DAYOFWEEK = "dayofweek" - DAYOFYEAR = "dayofyear" + DAYOFWEEK = "dow" + DAYOFYEAR = "doy" def to_int(self) -> int: """Convert to an int so that the size of the granularity can be easily compared.""" From 64164d92ba309c247efb7c980623dcd70fd8fbe9 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 11 Sep 2023 20:51:25 -0700 Subject: [PATCH 08/15] Renaming --- metricflow/sql/render/big_query.py | 12 + metricflow/sql/render/databricks.py | 8 - metricflow/sql/render/expr_renderer.py | 2 +- .../dataset/test_convert_semantic_model.py | 24 +- metricflow/test/generate_snapshots.py | 40 +- .../integration/test_cases/itest_metrics.yaml | 8 +- ...st_convert_query_semantic_model__plan0.sql | 28 +- ...le_semantic_model_with_measures__plan0.sql | 56 +- ...semantic_model_without_measures__plan0.sql | 28 +- ...st_convert_query_semantic_model__plan0.sql | 28 +- ...le_semantic_model_with_measures__plan0.sql | 56 +- ...semantic_model_without_measures__plan0.sql | 28 +- ...st_convert_query_semantic_model__plan0.sql | 28 +- ...le_semantic_model_with_measures__plan0.sql | 56 +- ...semantic_model_without_measures__plan0.sql | 28 +- ...st_convert_query_semantic_model__plan0.sql | 28 +- ...le_semantic_model_with_measures__plan0.sql | 56 +- ...semantic_model_without_measures__plan0.sql | 28 +- ...st_convert_query_semantic_model__plan0.sql | 28 +- ...le_semantic_model_with_measures__plan0.sql | 56 +- ...semantic_model_without_measures__plan0.sql | 28 +- ...st_convert_query_semantic_model__plan0.sql | 28 +- ...le_semantic_model_with_measures__plan0.sql | 56 +- ...semantic_model_without_measures__plan0.sql | 28 +- .../test_multihop_join_plan__dfp_0.xml | 32 +- .../test_common_semantic_model__plan0.sql | 224 ++++---- .../test_compute_metrics_node__plan0.sql | 140 ++--- ...o_from_multiple_semantic_models__plan0.sql | 340 ++++++------ ...atio_from_single_semantic_model__plan0.sql | 140 ++--- ...ompute_metrics_node_simple_expr__plan0.sql | 140 ++--- .../test_constrain_time_range_node__plan0.sql | 84 +-- .../test_cumulative_metric__plan0.sql | 40 +- ...cumulative_metric_grain_to_date__plan0.sql | 40 +- .../test_cumulative_metric_no_ds__plan0.sql | 40 +- ...est_cumulative_metric_no_window__plan0.sql | 40 +- ..._no_window_with_time_constraint__plan0.sql | 52 +- ...ive_metric_with_time_constraint__plan0.sql | 52 +- .../BigQuery/test_derived_metric__plan0.sql | 224 ++++---- ...ved_metric_with_offset_to_grain__plan0.sql | 248 ++++----- ...offset_to_grain_and_granularity__plan0.sql | 248 ++++----- ...rived_metric_with_offset_window__plan0.sql | 248 ++++----- ...h_offset_window_and_granularity__plan0.sql | 248 ++++----- ...fset_window_and_offset_to_grain__plan0.sql | 272 +++++----- ...offset_to_grain_and_granularity__plan0.sql | 272 +++++----- ...erived_offset_cumulative_metric__plan0.sql | 164 +++--- ...et_metric_with_one_input_metric__plan0.sql | 136 ++--- .../BigQuery/test_distinct_values__plan0.sql | 188 +++---- .../BigQuery/test_filter_node__plan0.sql | 84 +-- ...lter_with_where_constraint_node__plan0.sql | 84 +-- ...th_where_constraint_on_join_dim__plan0.sql | 188 +++---- .../test_join_to_scd_dimension__plan0.sql | 168 +++--- ...spine_node_with_offset_to_grain__plan0.sql | 112 ++-- ...e_spine_node_with_offset_window__plan0.sql | 112 ++-- ..._time_spine_node_without_offset__plan0.sql | 112 ++-- .../BigQuery/test_limit_rows__plan0.sql | 112 ++-- ...al_dimension_using_local_entity__plan0.sql | 76 +-- .../test_measure_aggregation_node__plan0.sql | 84 +-- .../test_measure_constraint__plan0.sql | 488 +++++++++--------- ..._constraint_with_reused_measure__plan0.sql | 224 ++++---- ...aint_with_single_expr_and_alias__plan0.sql | 112 ++-- ..._multiple_sources_no_dimensions__plan0.sql | 188 +++---- ...multi_hop_through_scd_dimension__plan0.sql | 224 ++++---- ...test_multi_hop_to_scd_dimension__plan0.sql | 192 +++---- .../BigQuery/test_multi_join_node__plan0.sql | 196 +++---- .../BigQuery/test_multihop_node__plan0.sql | 152 +++--- ..._multiple_metrics_no_dimensions__plan0.sql | 236 ++++----- .../test_nested_derived_metric__plan0.sql | 448 ++++++++-------- .../BigQuery/test_order_by_node__plan0.sql | 84 +-- .../BigQuery/test_partitioned_join__plan0.sql | 160 +++--- .../test_semi_additive_join_node__plan0.sql | 64 +-- ...mi_additive_join_node__plan0_optimized.sql | 36 +- ...dditive_join_node_with_grouping__plan0.sql | 64 +-- ...in_node_with_grouping__plan0_optimized.sql | 36 +- ...join_node_with_queried_group_by__plan0.sql | 64 +-- ...with_queried_group_by__plan0_optimized.sql | 36 +- .../BigQuery/test_single_join_node__plan0.sql | 140 ++--- .../BigQuery/test_source_node__plan0.sql | 84 +-- .../test_source_node__plan0_optimized.sql | 84 +-- .../test_common_semantic_model__plan0.sql | 224 ++++---- .../test_compute_metrics_node__plan0.sql | 140 ++--- ...o_from_multiple_semantic_models__plan0.sql | 340 ++++++------ ...atio_from_single_semantic_model__plan0.sql | 140 ++--- ...ompute_metrics_node_simple_expr__plan0.sql | 140 ++--- .../test_constrain_time_range_node__plan0.sql | 84 +-- .../test_cumulative_metric__plan0.sql | 40 +- ...cumulative_metric_grain_to_date__plan0.sql | 40 +- .../test_cumulative_metric_no_ds__plan0.sql | 40 +- ...est_cumulative_metric_no_window__plan0.sql | 40 +- ..._no_window_with_time_constraint__plan0.sql | 52 +- ...ive_metric_with_time_constraint__plan0.sql | 52 +- .../Databricks/test_derived_metric__plan0.sql | 224 ++++---- ...ved_metric_with_offset_to_grain__plan0.sql | 248 ++++----- ...offset_to_grain_and_granularity__plan0.sql | 248 ++++----- ...rived_metric_with_offset_window__plan0.sql | 248 ++++----- ...h_offset_window_and_granularity__plan0.sql | 248 ++++----- ...fset_window_and_offset_to_grain__plan0.sql | 272 +++++----- ...offset_to_grain_and_granularity__plan0.sql | 272 +++++----- ...erived_offset_cumulative_metric__plan0.sql | 164 +++--- ...et_metric_with_one_input_metric__plan0.sql | 136 ++--- .../test_distinct_values__plan0.sql | 188 +++---- .../Databricks/test_filter_node__plan0.sql | 84 +-- ...lter_with_where_constraint_node__plan0.sql | 84 +-- ...th_where_constraint_on_join_dim__plan0.sql | 188 +++---- .../test_join_to_scd_dimension__plan0.sql | 168 +++--- ...spine_node_with_offset_to_grain__plan0.sql | 112 ++-- ...e_spine_node_with_offset_window__plan0.sql | 112 ++-- ..._time_spine_node_without_offset__plan0.sql | 112 ++-- .../Databricks/test_limit_rows__plan0.sql | 112 ++-- ...al_dimension_using_local_entity__plan0.sql | 76 +-- .../test_measure_aggregation_node__plan0.sql | 84 +-- .../test_measure_constraint__plan0.sql | 488 +++++++++--------- ..._constraint_with_reused_measure__plan0.sql | 224 ++++---- ...aint_with_single_expr_and_alias__plan0.sql | 112 ++-- ..._multiple_sources_no_dimensions__plan0.sql | 188 +++---- ...multi_hop_through_scd_dimension__plan0.sql | 224 ++++---- ...test_multi_hop_to_scd_dimension__plan0.sql | 192 +++---- .../test_multi_join_node__plan0.sql | 196 +++---- .../Databricks/test_multihop_node__plan0.sql | 152 +++--- ..._multiple_metrics_no_dimensions__plan0.sql | 236 ++++----- .../test_nested_derived_metric__plan0.sql | 448 ++++++++-------- .../Databricks/test_order_by_node__plan0.sql | 84 +-- .../test_partitioned_join__plan0.sql | 160 +++--- .../test_semi_additive_join_node__plan0.sql | 64 +-- ...mi_additive_join_node__plan0_optimized.sql | 36 +- ...dditive_join_node_with_grouping__plan0.sql | 64 +-- ...in_node_with_grouping__plan0_optimized.sql | 36 +- ...join_node_with_queried_group_by__plan0.sql | 64 +-- ...with_queried_group_by__plan0_optimized.sql | 36 +- .../test_single_join_node__plan0.sql | 140 ++--- .../Databricks/test_source_node__plan0.sql | 84 +-- .../test_source_node__plan0_optimized.sql | 84 +-- .../test_common_semantic_model__plan0.sql | 168 +++--- .../test_compute_metrics_node__plan0.sql | 140 ++--- ...o_from_multiple_semantic_models__plan0.sql | 252 ++++----- ...atio_from_single_semantic_model__plan0.sql | 140 ++--- ...ompute_metrics_node_simple_expr__plan0.sql | 140 ++--- .../test_constrain_time_range_node__plan0.sql | 84 +-- .../DuckDB/test_cumulative_metric__plan0.sql | 28 +- ...cumulative_metric_grain_to_date__plan0.sql | 28 +- .../test_cumulative_metric_no_ds__plan0.sql | 28 +- ...est_cumulative_metric_no_window__plan0.sql | 28 +- ..._no_window_with_time_constraint__plan0.sql | 28 +- ...ive_metric_with_time_constraint__plan0.sql | 28 +- .../DuckDB/test_derived_metric__plan0.sql | 168 +++--- ...ved_metric_with_offset_to_grain__plan0.sql | 168 +++--- ...offset_to_grain_and_granularity__plan0.sql | 168 +++--- ...rived_metric_with_offset_window__plan0.sql | 168 +++--- ...h_offset_window_and_granularity__plan0.sql | 168 +++--- ...fset_window_and_offset_to_grain__plan0.sql | 168 +++--- ...offset_to_grain_and_granularity__plan0.sql | 168 +++--- ...erived_offset_cumulative_metric__plan0.sql | 84 +-- ...et_metric_with_one_input_metric__plan0.sql | 84 +-- .../DuckDB/test_distinct_values__plan0.sql | 140 ++--- .../DuckDB/test_filter_node__plan0.sql | 84 +-- ...lter_with_where_constraint_node__plan0.sql | 84 +-- ...th_where_constraint_on_join_dim__plan0.sql | 140 ++--- .../test_join_to_scd_dimension__plan0.sql | 140 ++--- ...spine_node_with_offset_to_grain__plan0.sql | 84 +-- ...e_spine_node_with_offset_window__plan0.sql | 84 +-- ..._time_spine_node_without_offset__plan0.sql | 84 +-- .../DuckDB/test_limit_rows__plan0.sql | 84 +-- ...al_dimension_using_local_entity__plan0.sql | 56 +- .../test_measure_aggregation_node__plan0.sql | 84 +-- .../DuckDB/test_measure_constraint__plan0.sql | 364 ++++++------- ..._constraint_with_reused_measure__plan0.sql | 168 +++--- ...aint_with_single_expr_and_alias__plan0.sql | 84 +-- ..._multiple_sources_no_dimensions__plan0.sql | 140 ++--- ...multi_hop_through_scd_dimension__plan0.sql | 168 +++--- ...test_multi_hop_to_scd_dimension__plan0.sql | 140 ++--- .../DuckDB/test_multi_join_node__plan0.sql | 196 +++---- .../DuckDB/test_multihop_node__plan0.sql | 112 ++-- ..._multiple_metrics_no_dimensions__plan0.sql | 140 ++--- .../test_nested_derived_metric__plan0.sql | 336 ++++++------ .../DuckDB/test_order_by_node__plan0.sql | 84 +-- .../DuckDB/test_partitioned_join__plan0.sql | 140 ++--- .../test_semi_additive_join_node__plan0.sql | 56 +- ...mi_additive_join_node__plan0_optimized.sql | 28 +- ...dditive_join_node_with_grouping__plan0.sql | 56 +- ...in_node_with_grouping__plan0_optimized.sql | 28 +- ...join_node_with_queried_group_by__plan0.sql | 56 +- ...with_queried_group_by__plan0_optimized.sql | 28 +- .../DuckDB/test_single_join_node__plan0.sql | 140 ++--- .../DuckDB/test_source_node__plan0.sql | 84 +-- .../test_source_node__plan0_optimized.sql | 84 +-- .../test_common_semantic_model__plan0.sql | 224 ++++---- .../test_compute_metrics_node__plan0.sql | 140 ++--- ...o_from_multiple_semantic_models__plan0.sql | 340 ++++++------ ...atio_from_single_semantic_model__plan0.sql | 140 ++--- ...ompute_metrics_node_simple_expr__plan0.sql | 140 ++--- .../test_constrain_time_range_node__plan0.sql | 84 +-- .../test_cumulative_metric__plan0.sql | 40 +- ...cumulative_metric_grain_to_date__plan0.sql | 40 +- .../test_cumulative_metric_no_ds__plan0.sql | 40 +- ...est_cumulative_metric_no_window__plan0.sql | 40 +- ..._no_window_with_time_constraint__plan0.sql | 52 +- ...ive_metric_with_time_constraint__plan0.sql | 52 +- .../Postgres/test_derived_metric__plan0.sql | 224 ++++---- ...ved_metric_with_offset_to_grain__plan0.sql | 248 ++++----- ...offset_to_grain_and_granularity__plan0.sql | 248 ++++----- ...rived_metric_with_offset_window__plan0.sql | 248 ++++----- ...h_offset_window_and_granularity__plan0.sql | 248 ++++----- ...fset_window_and_offset_to_grain__plan0.sql | 272 +++++----- ...offset_to_grain_and_granularity__plan0.sql | 272 +++++----- ...erived_offset_cumulative_metric__plan0.sql | 164 +++--- ...et_metric_with_one_input_metric__plan0.sql | 136 ++--- .../Postgres/test_distinct_values__plan0.sql | 188 +++---- .../Postgres/test_filter_node__plan0.sql | 84 +-- ...lter_with_where_constraint_node__plan0.sql | 84 +-- ...th_where_constraint_on_join_dim__plan0.sql | 188 +++---- .../test_join_to_scd_dimension__plan0.sql | 168 +++--- ...spine_node_with_offset_to_grain__plan0.sql | 112 ++-- ...e_spine_node_with_offset_window__plan0.sql | 112 ++-- ..._time_spine_node_without_offset__plan0.sql | 112 ++-- .../Postgres/test_limit_rows__plan0.sql | 112 ++-- ...al_dimension_using_local_entity__plan0.sql | 76 +-- .../test_measure_aggregation_node__plan0.sql | 84 +-- .../test_measure_constraint__plan0.sql | 488 +++++++++--------- ..._constraint_with_reused_measure__plan0.sql | 224 ++++---- ...aint_with_single_expr_and_alias__plan0.sql | 112 ++-- ..._multiple_sources_no_dimensions__plan0.sql | 188 +++---- ...multi_hop_through_scd_dimension__plan0.sql | 224 ++++---- ...test_multi_hop_to_scd_dimension__plan0.sql | 192 +++---- .../Postgres/test_multi_join_node__plan0.sql | 196 +++---- .../Postgres/test_multihop_node__plan0.sql | 152 +++--- ..._multiple_metrics_no_dimensions__plan0.sql | 236 ++++----- .../test_nested_derived_metric__plan0.sql | 448 ++++++++-------- .../Postgres/test_order_by_node__plan0.sql | 84 +-- .../Postgres/test_partitioned_join__plan0.sql | 160 +++--- .../test_semi_additive_join_node__plan0.sql | 64 +-- ...mi_additive_join_node__plan0_optimized.sql | 36 +- ...dditive_join_node_with_grouping__plan0.sql | 64 +-- ...in_node_with_grouping__plan0_optimized.sql | 36 +- ...join_node_with_queried_group_by__plan0.sql | 64 +-- ...with_queried_group_by__plan0_optimized.sql | 36 +- .../Postgres/test_single_join_node__plan0.sql | 140 ++--- .../Postgres/test_source_node__plan0.sql | 84 +-- .../test_source_node__plan0_optimized.sql | 84 +-- .../test_common_semantic_model__plan0.sql | 224 ++++---- .../test_compute_metrics_node__plan0.sql | 140 ++--- ...o_from_multiple_semantic_models__plan0.sql | 340 ++++++------ ...atio_from_single_semantic_model__plan0.sql | 140 ++--- ...ompute_metrics_node_simple_expr__plan0.sql | 140 ++--- .../test_constrain_time_range_node__plan0.sql | 84 +-- .../test_cumulative_metric__plan0.sql | 40 +- ...cumulative_metric_grain_to_date__plan0.sql | 40 +- .../test_cumulative_metric_no_ds__plan0.sql | 40 +- ...est_cumulative_metric_no_window__plan0.sql | 40 +- ..._no_window_with_time_constraint__plan0.sql | 52 +- ...ive_metric_with_time_constraint__plan0.sql | 52 +- .../Redshift/test_derived_metric__plan0.sql | 224 ++++---- ...ved_metric_with_offset_to_grain__plan0.sql | 248 ++++----- ...offset_to_grain_and_granularity__plan0.sql | 248 ++++----- ...rived_metric_with_offset_window__plan0.sql | 248 ++++----- ...h_offset_window_and_granularity__plan0.sql | 248 ++++----- ...fset_window_and_offset_to_grain__plan0.sql | 272 +++++----- ...offset_to_grain_and_granularity__plan0.sql | 272 +++++----- ...erived_offset_cumulative_metric__plan0.sql | 164 +++--- ...et_metric_with_one_input_metric__plan0.sql | 136 ++--- .../Redshift/test_distinct_values__plan0.sql | 188 +++---- .../Redshift/test_filter_node__plan0.sql | 84 +-- ...lter_with_where_constraint_node__plan0.sql | 84 +-- ...th_where_constraint_on_join_dim__plan0.sql | 188 +++---- .../test_join_to_scd_dimension__plan0.sql | 168 +++--- ...spine_node_with_offset_to_grain__plan0.sql | 112 ++-- ...e_spine_node_with_offset_window__plan0.sql | 112 ++-- ..._time_spine_node_without_offset__plan0.sql | 112 ++-- .../Redshift/test_limit_rows__plan0.sql | 112 ++-- ...al_dimension_using_local_entity__plan0.sql | 76 +-- .../test_measure_aggregation_node__plan0.sql | 84 +-- .../test_measure_constraint__plan0.sql | 488 +++++++++--------- ..._constraint_with_reused_measure__plan0.sql | 224 ++++---- ...aint_with_single_expr_and_alias__plan0.sql | 112 ++-- ..._multiple_sources_no_dimensions__plan0.sql | 188 +++---- ...multi_hop_through_scd_dimension__plan0.sql | 224 ++++---- ...test_multi_hop_to_scd_dimension__plan0.sql | 192 +++---- .../Redshift/test_multi_join_node__plan0.sql | 196 +++---- .../Redshift/test_multihop_node__plan0.sql | 152 +++--- ..._multiple_metrics_no_dimensions__plan0.sql | 236 ++++----- .../test_nested_derived_metric__plan0.sql | 448 ++++++++-------- .../Redshift/test_order_by_node__plan0.sql | 84 +-- .../Redshift/test_partitioned_join__plan0.sql | 160 +++--- .../test_semi_additive_join_node__plan0.sql | 64 +-- ...mi_additive_join_node__plan0_optimized.sql | 36 +- ...dditive_join_node_with_grouping__plan0.sql | 64 +-- ...in_node_with_grouping__plan0_optimized.sql | 36 +- ...join_node_with_queried_group_by__plan0.sql | 64 +-- ...with_queried_group_by__plan0_optimized.sql | 36 +- .../Redshift/test_single_join_node__plan0.sql | 140 ++--- .../Redshift/test_source_node__plan0.sql | 84 +-- .../test_source_node__plan0_optimized.sql | 84 +-- .../test_common_semantic_model__plan0.sql | 224 ++++---- .../test_compute_metrics_node__plan0.sql | 140 ++--- ...o_from_multiple_semantic_models__plan0.sql | 340 ++++++------ ...atio_from_single_semantic_model__plan0.sql | 140 ++--- ...ompute_metrics_node_simple_expr__plan0.sql | 140 ++--- .../test_constrain_time_range_node__plan0.sql | 84 +-- .../test_cumulative_metric__plan0.sql | 40 +- ...cumulative_metric_grain_to_date__plan0.sql | 40 +- .../test_cumulative_metric_no_ds__plan0.sql | 40 +- ...est_cumulative_metric_no_window__plan0.sql | 40 +- ..._no_window_with_time_constraint__plan0.sql | 52 +- ...ive_metric_with_time_constraint__plan0.sql | 52 +- .../Snowflake/test_derived_metric__plan0.sql | 224 ++++---- ...ved_metric_with_offset_to_grain__plan0.sql | 248 ++++----- ...offset_to_grain_and_granularity__plan0.sql | 248 ++++----- ...rived_metric_with_offset_window__plan0.sql | 248 ++++----- ...h_offset_window_and_granularity__plan0.sql | 248 ++++----- ...fset_window_and_offset_to_grain__plan0.sql | 272 +++++----- ...offset_to_grain_and_granularity__plan0.sql | 272 +++++----- ...erived_offset_cumulative_metric__plan0.sql | 164 +++--- ...et_metric_with_one_input_metric__plan0.sql | 136 ++--- .../Snowflake/test_distinct_values__plan0.sql | 188 +++---- .../Snowflake/test_filter_node__plan0.sql | 84 +-- ...lter_with_where_constraint_node__plan0.sql | 84 +-- ...th_where_constraint_on_join_dim__plan0.sql | 188 +++---- .../test_join_to_scd_dimension__plan0.sql | 168 +++--- ...spine_node_with_offset_to_grain__plan0.sql | 112 ++-- ...e_spine_node_with_offset_window__plan0.sql | 112 ++-- ..._time_spine_node_without_offset__plan0.sql | 112 ++-- .../Snowflake/test_limit_rows__plan0.sql | 112 ++-- ...al_dimension_using_local_entity__plan0.sql | 76 +-- .../test_measure_aggregation_node__plan0.sql | 84 +-- .../test_measure_constraint__plan0.sql | 488 +++++++++--------- ..._constraint_with_reused_measure__plan0.sql | 224 ++++---- ...aint_with_single_expr_and_alias__plan0.sql | 112 ++-- ..._multiple_sources_no_dimensions__plan0.sql | 188 +++---- ...multi_hop_through_scd_dimension__plan0.sql | 224 ++++---- ...test_multi_hop_to_scd_dimension__plan0.sql | 192 +++---- .../Snowflake/test_multi_join_node__plan0.sql | 196 +++---- .../Snowflake/test_multihop_node__plan0.sql | 152 +++--- ..._multiple_metrics_no_dimensions__plan0.sql | 236 ++++----- .../test_nested_derived_metric__plan0.sql | 448 ++++++++-------- .../Snowflake/test_order_by_node__plan0.sql | 84 +-- .../test_partitioned_join__plan0.sql | 160 +++--- .../test_semi_additive_join_node__plan0.sql | 64 +-- ...mi_additive_join_node__plan0_optimized.sql | 36 +- ...dditive_join_node_with_grouping__plan0.sql | 64 +-- ...in_node_with_grouping__plan0_optimized.sql | 36 +- ...join_node_with_queried_group_by__plan0.sql | 64 +-- ...with_queried_group_by__plan0_optimized.sql | 36 +- .../test_single_join_node__plan0.sql | 140 ++--- .../Snowflake/test_source_node__plan0.sql | 84 +-- .../test_source_node__plan0_optimized.sql | 84 +-- ...orm_node_using_non_primary_time__plan0.sql | 112 ++-- ...sing_non_primary_time__plan0_optimized.sql | 98 ++-- ...ansform_node_using_primary_time__plan0.sql | 112 ++-- ...de_using_primary_time__plan0_optimized.sql | 98 ++-- ...uery_with_metric_time_dimension__plan0.sql | 224 ++++---- ...orm_node_using_non_primary_time__plan0.sql | 112 ++-- ...sing_non_primary_time__plan0_optimized.sql | 98 ++-- ...ansform_node_using_primary_time__plan0.sql | 112 ++-- ...de_using_primary_time__plan0_optimized.sql | 98 ++-- ...uery_with_metric_time_dimension__plan0.sql | 224 ++++---- ...orm_node_using_non_primary_time__plan0.sql | 84 +-- ...sing_non_primary_time__plan0_optimized.sql | 98 ++-- ...ansform_node_using_primary_time__plan0.sql | 84 +-- ...de_using_primary_time__plan0_optimized.sql | 98 ++-- ...uery_with_metric_time_dimension__plan0.sql | 168 +++--- ...orm_node_using_non_primary_time__plan0.sql | 112 ++-- ...sing_non_primary_time__plan0_optimized.sql | 98 ++-- ...ansform_node_using_primary_time__plan0.sql | 112 ++-- ...de_using_primary_time__plan0_optimized.sql | 98 ++-- ...uery_with_metric_time_dimension__plan0.sql | 224 ++++---- ...orm_node_using_non_primary_time__plan0.sql | 112 ++-- ...sing_non_primary_time__plan0_optimized.sql | 98 ++-- ...ansform_node_using_primary_time__plan0.sql | 112 ++-- ...de_using_primary_time__plan0_optimized.sql | 98 ++-- ...uery_with_metric_time_dimension__plan0.sql | 224 ++++---- ...orm_node_using_non_primary_time__plan0.sql | 112 ++-- ...sing_non_primary_time__plan0_optimized.sql | 98 ++-- ...ansform_node_using_primary_time__plan0.sql | 112 ++-- ...de_using_primary_time__plan0_optimized.sql | 98 ++-- ...uery_with_metric_time_dimension__plan0.sql | 224 ++++---- metricflow/test/sql/test_sql_expr_render.py | 4 +- metricflow/time/date_part.py | 8 +- 375 files changed, 25409 insertions(+), 25405 deletions(-) diff --git a/metricflow/sql/render/big_query.py b/metricflow/sql/render/big_query.py index f5c15a2ab6..9b55c6a28d 100644 --- a/metricflow/sql/render/big_query.py +++ b/metricflow/sql/render/big_query.py @@ -24,6 +24,7 @@ SqlTimeDeltaExpression, ) from metricflow.sql.sql_plan import SqlSelectColumn +from metricflow.time.date_part import DatePart class BigQuerySqlExpressionRenderer(DefaultSqlExpressionRenderer): @@ -129,6 +130,17 @@ def visit_date_trunc_expr(self, node: SqlDateTruncExpression) -> SqlExpressionRe bind_parameters=arg_rendered.bind_parameters, ) + @override + def render_date_part(self, date_part: DatePart) -> str: + if date_part == DatePart.DOY: + return "DAYOFYEAR" + if date_part == DatePart.DOW: + return "DAYOFWEEK" + if date_part == DatePart.WEEK: + return "ISOWEEK" + + return super().render_date_part(date_part) + @override def visit_time_delta_expr(self, node: SqlTimeDeltaExpression) -> SqlExpressionRenderResult: """Render time delta for BigQuery, which requires ISO prefixing for the WEEK granularity value.""" diff --git a/metricflow/sql/render/databricks.py b/metricflow/sql/render/databricks.py index 307f15ba24..0740f66350 100644 --- a/metricflow/sql/render/databricks.py +++ b/metricflow/sql/render/databricks.py @@ -13,7 +13,6 @@ ) from metricflow.sql.render.sql_plan_renderer import DefaultSqlQueryPlanRenderer from metricflow.sql.sql_exprs import SqlPercentileExpression, SqlPercentileFunctionType -from metricflow.time.date_part import DatePart class DatabricksSqlExpressionRenderer(DefaultSqlExpressionRenderer): @@ -57,13 +56,6 @@ def visit_percentile_expr(self, node: SqlPercentileExpression) -> SqlExpressionR bind_parameters=params, ) - @override - def render_date_part(self, date_part: DatePart) -> str: - if date_part == DatePart.DAYOFYEAR: - return "DOY" - - return super().render_date_part(date_part) - class DatabricksSqlQueryPlanRenderer(DefaultSqlQueryPlanRenderer): """Plan renderer for the Snowflake engine.""" diff --git a/metricflow/sql/render/expr_renderer.py b/metricflow/sql/render/expr_renderer.py index 105c83e862..9a5e58a465 100644 --- a/metricflow/sql/render/expr_renderer.py +++ b/metricflow/sql/render/expr_renderer.py @@ -279,7 +279,7 @@ def visit_extract_expr(self, node: SqlExtractExpression) -> SqlExpressionRenderR def render_date_part(self, date_part: DatePart) -> str: """Render DATE PART for an EXTRACT expression.""" - return date_part.name + return date_part.value def visit_time_delta_expr(self, node: SqlTimeDeltaExpression) -> SqlExpressionRenderResult: # noqa: D arg_rendered = node.arg.accept(self) diff --git a/metricflow/test/dataset/test_convert_semantic_model.py b/metricflow/test/dataset/test_convert_semantic_model.py index d830438ea5..747510ff6e 100644 --- a/metricflow/test/dataset/test_convert_semantic_model.py +++ b/metricflow/test/dataset/test_convert_semantic_model.py @@ -66,10 +66,10 @@ def test_convert_table_semantic_model_without_measures( # noqa: D element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAY ), TimeDimensionSpec( - element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFWEEK + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DOW ), TimeDimensionSpec( - element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFYEAR + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DOY ), TimeDimensionSpec( element_name="ds", @@ -130,13 +130,13 @@ def test_convert_table_semantic_model_without_measures( # noqa: D element_name="ds", entity_links=(EntityReference(element_name="user"),), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFWEEK, + date_part=DatePart.DOW, ), TimeDimensionSpec( element_name="ds", entity_links=(EntityReference(element_name="user"),), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFYEAR, + date_part=DatePart.DOY, ), ), ) @@ -205,10 +205,10 @@ def test_convert_table_semantic_model_with_measures( # noqa: D element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAY ), TimeDimensionSpec( - element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFWEEK + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DOW ), TimeDimensionSpec( - element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DAYOFYEAR + element_name="ds", entity_links=(), time_granularity=TimeGranularity.DAY, date_part=DatePart.DOY ), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.DAY), TimeDimensionSpec(element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.WEEK), @@ -249,13 +249,13 @@ def test_convert_table_semantic_model_with_measures( # noqa: D element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFWEEK, + date_part=DatePart.DOW, ), TimeDimensionSpec( element_name="ds_partitioned", entity_links=(), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFYEAR, + date_part=DatePart.DOY, ), TimeDimensionSpec( element_name="ds", @@ -316,13 +316,13 @@ def test_convert_table_semantic_model_with_measures( # noqa: D element_name="ds", entity_links=(EntityReference(element_name="verification"),), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFWEEK, + date_part=DatePart.DOW, ), TimeDimensionSpec( element_name="ds", entity_links=(EntityReference(element_name="verification"),), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFYEAR, + date_part=DatePart.DOY, ), TimeDimensionSpec( element_name="ds_partitioned", @@ -383,13 +383,13 @@ def test_convert_table_semantic_model_with_measures( # noqa: D element_name="ds_partitioned", entity_links=(EntityReference(element_name="verification"),), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFWEEK, + date_part=DatePart.DOW, ), TimeDimensionSpec( element_name="ds_partitioned", entity_links=(EntityReference(element_name="verification"),), time_granularity=TimeGranularity.DAY, - date_part=DatePart.DAYOFYEAR, + date_part=DatePart.DOY, ), ), ) diff --git a/metricflow/test/generate_snapshots.py b/metricflow/test/generate_snapshots.py index 64b87d91b5..9acafe9573 100644 --- a/metricflow/test/generate_snapshots.py +++ b/metricflow/test/generate_snapshots.py @@ -70,30 +70,30 @@ class MetricFlowTestCredentialSetForAllEngines(FrozenBaseModel): # noqa: D @property def as_configurations(self) -> Sequence[MetricFlowTestConfiguration]: # noqa: D return ( - MetricFlowTestConfiguration( - engine=SqlEngine.DUCKDB, - credential_set=self.duck_db, - ), - MetricFlowTestConfiguration( - engine=SqlEngine.REDSHIFT, - credential_set=self.redshift, - ), - MetricFlowTestConfiguration( - engine=SqlEngine.SNOWFLAKE, - credential_set=self.snowflake, - ), + # MetricFlowTestConfiguration( + # engine=SqlEngine.DUCKDB, + # credential_set=self.duck_db, + # ), + # MetricFlowTestConfiguration( + # engine=SqlEngine.REDSHIFT, + # credential_set=self.redshift, + # ), + # MetricFlowTestConfiguration( + # engine=SqlEngine.SNOWFLAKE, + # credential_set=self.snowflake, + # ), MetricFlowTestConfiguration( engine=SqlEngine.BIGQUERY, credential_set=self.big_query, ), - MetricFlowTestConfiguration( - engine=SqlEngine.DATABRICKS, - credential_set=self.databricks, - ), - MetricFlowTestConfiguration( - engine=SqlEngine.POSTGRES, - credential_set=self.postgres, - ), + # MetricFlowTestConfiguration( + # engine=SqlEngine.DATABRICKS, + # credential_set=self.databricks, + # ), + # MetricFlowTestConfiguration( + # engine=SqlEngine.POSTGRES, + # credential_set=self.postgres, + # ), ) diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index aa184a67e1..bd53ff686f 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1067,15 +1067,15 @@ integration_test: SELECT SUM(1) AS bookings , {{ render_extract("ds", DatePart.QUARTER) }} AS metric_time__extract_quarter - , {{ render_extract("ds", DatePart.DAYOFWEEK) }} AS metric_time__extract_dow - , {{ render_extract("ds", DatePart.DAYOFYEAR) }} AS metric_time__extract_doy + , {{ render_extract("ds", DatePart.DOW) }} AS metric_time__extract_dow + , {{ render_extract("ds", DatePart.DOY) }} AS metric_time__extract_doy , {{ render_extract("ds", DatePart.DAY) }} AS metric_time__extract_day , {{ render_extract("ds", DatePart.WEEK) }} AS metric_time__extract_week FROM {{ source_schema }}.fct_bookings GROUP BY {{ render_extract("ds", DatePart.QUARTER) }} - , {{ render_extract("ds", DatePart.DAYOFWEEK) }} - , {{ render_extract("ds", DatePart.DAYOFYEAR) }} + , {{ render_extract("ds", DatePart.DOW) }} + , {{ render_extract("ds", DatePart.DOY) }} , {{ render_extract("ds", DatePart.DAY) }} , {{ render_extract("ds", DatePart.WEEK) }}; --- diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql index 6a18fb55ab..f00e2be64e 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql @@ -6,25 +6,25 @@ SELECT , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql index be4db1864b..b6a752aa1c 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,50 +6,50 @@ SELECT , DATE_TRUNC(id_verifications_src_10003.ds, month) AS ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week , DATE_TRUNC(id_verifications_src_10003.ds, month) AS verification__ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS verification__ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS verification__ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql index b4f8805489..c698caae42 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,26 +5,26 @@ SELECT , DATE_TRUNC(users_latest_src_10008.ds, month) AS ds__month , DATE_TRUNC(users_latest_src_10008.ds, quarter) AS ds__quarter , DATE_TRUNC(users_latest_src_10008.ds, year) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC(users_latest_src_10008.ds, isoweek) AS user__ds__week , DATE_TRUNC(users_latest_src_10008.ds, month) AS user__ds__month , DATE_TRUNC(users_latest_src_10008.ds, quarter) AS user__ds__quarter , DATE_TRUNC(users_latest_src_10008.ds, year) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(ISOWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql index 28bd5c725b..dab2be52a2 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_query_semantic_model__plan0.sql @@ -6,25 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql index dbb952f05b..93f9b1f47a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,50 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql index 60db7389f0..e96f783576 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Databricks/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,26 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM users_latest_src_10008.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek - , EXTRACT(DOY FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql index db7d8060c4..dab2be52a2 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_query_semantic_model__plan0.sql @@ -6,25 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql index dd7ccdf1b3..93f9b1f47a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,50 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql index c62de83dc6..e96f783576 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/DuckDB/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,26 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_doy + , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_doy + , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql index 390e922160..dab2be52a2 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_query_semantic_model__plan0.sql @@ -6,25 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql index 4a4b1f53f4..93f9b1f47a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,50 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql index e3f2a1d31a..e96f783576 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Postgres/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,26 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql index 390e922160..dab2be52a2 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_query_semantic_model__plan0.sql @@ -6,25 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql index 4a4b1f53f4..93f9b1f47a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,50 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql index e3f2a1d31a..e96f783576 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Redshift/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,26 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql index 390e922160..dab2be52a2 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_query_semantic_model__plan0.sql @@ -6,25 +6,25 @@ SELECT , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql index 4a4b1f53f4..93f9b1f47a 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_with_measures__plan0.sql @@ -6,50 +6,50 @@ SELECT , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql index e3f2a1d31a..e96f783576 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/Snowflake/test_convert_table_semantic_model_without_measures__plan0.sql @@ -5,26 +5,26 @@ SELECT , DATE_TRUNC('month', users_latest_src_10008.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10008.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10008.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10008.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10008.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10008.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10008.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml index 289229a67a..4b1abcc4e0 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml @@ -253,20 +253,20 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + @@ -342,14 +342,14 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql index 98ccda3807..8d272a50fc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -379,74 +379,74 @@ FULL OUTER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql index c647a56b30..fdcc14c145 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 561210bfe0..a0d4381867 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -56,8 +56,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -68,8 +68,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -80,8 +80,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -116,8 +116,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -128,8 +128,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -174,74 +174,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -271,8 +271,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -283,8 +283,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -295,8 +295,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -307,8 +307,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -319,8 +319,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -344,25 +344,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,25 +371,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -455,8 +455,8 @@ FROM ( , subq_10.ds__extract_month , subq_10.ds__extract_week , subq_10.ds__extract_day - , subq_10.ds__extract_dayofweek - , subq_10.ds__extract_dayofyear + , subq_10.ds__extract_dow + , subq_10.ds__extract_doy , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month @@ -467,8 +467,8 @@ FROM ( , subq_10.ds_partitioned__extract_month , subq_10.ds_partitioned__extract_week , subq_10.ds_partitioned__extract_day - , subq_10.ds_partitioned__extract_dayofweek - , subq_10.ds_partitioned__extract_dayofyear + , subq_10.ds_partitioned__extract_dow + , subq_10.ds_partitioned__extract_doy , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month @@ -479,8 +479,8 @@ FROM ( , subq_10.view__ds__extract_month , subq_10.view__ds__extract_week , subq_10.view__ds__extract_day - , subq_10.view__ds__extract_dayofweek - , subq_10.view__ds__extract_dayofyear + , subq_10.view__ds__extract_dow + , subq_10.view__ds__extract_doy , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month @@ -491,8 +491,8 @@ FROM ( , subq_10.view__ds_partitioned__extract_month , subq_10.view__ds_partitioned__extract_week , subq_10.view__ds_partitioned__extract_day - , subq_10.view__ds_partitioned__extract_dayofweek - , subq_10.view__ds_partitioned__extract_dayofyear + , subq_10.view__ds_partitioned__extract_dow + , subq_10.view__ds_partitioned__extract_doy , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -503,8 +503,8 @@ FROM ( , subq_10.ds__extract_month AS metric_time__extract_month , subq_10.ds__extract_week AS metric_time__extract_week , subq_10.ds__extract_day AS metric_time__extract_day - , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_10.ds__extract_dow AS metric_time__extract_dow + , subq_10.ds__extract_doy AS metric_time__extract_doy , subq_10.listing , subq_10.user , subq_10.view__listing @@ -519,49 +519,49 @@ FROM ( , DATE_TRUNC(views_source_src_10009.ds, month) AS ds__month , DATE_TRUNC(views_source_src_10009.ds, quarter) AS ds__quarter , DATE_TRUNC(views_source_src_10009.ds, year) AS ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(views_source_src_10009.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(views_source_src_10009.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(views_source_src_10009.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(views_source_src_10009.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC(views_source_src_10009.ds, isoweek) AS view__ds__week , DATE_TRUNC(views_source_src_10009.ds, month) AS view__ds__month , DATE_TRUNC(views_source_src_10009.ds, quarter) AS view__ds__quarter , DATE_TRUNC(views_source_src_10009.ds, year) AS view__ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(ISOWEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC(views_source_src_10009.ds_partitioned, isoweek) AS view__ds_partitioned__week , DATE_TRUNC(views_source_src_10009.ds_partitioned, month) AS view__ds_partitioned__month , DATE_TRUNC(views_source_src_10009.ds_partitioned, quarter) AS view__ds_partitioned__quarter , DATE_TRUNC(views_source_src_10009.ds_partitioned, year) AS view__ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -589,8 +589,8 @@ FROM ( , subq_13.ds__extract_month , subq_13.ds__extract_week , subq_13.ds__extract_day - , subq_13.ds__extract_dayofweek - , subq_13.ds__extract_dayofyear + , subq_13.ds__extract_dow + , subq_13.ds__extract_doy , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month @@ -601,8 +601,8 @@ FROM ( , subq_13.created_at__extract_month , subq_13.created_at__extract_week , subq_13.created_at__extract_day - , subq_13.created_at__extract_dayofweek - , subq_13.created_at__extract_dayofyear + , subq_13.created_at__extract_dow + , subq_13.created_at__extract_doy , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month @@ -613,8 +613,8 @@ FROM ( , subq_13.listing__ds__extract_month , subq_13.listing__ds__extract_week , subq_13.listing__ds__extract_day - , subq_13.listing__ds__extract_dayofweek - , subq_13.listing__ds__extract_dayofyear + , subq_13.listing__ds__extract_dow + , subq_13.listing__ds__extract_doy , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month @@ -625,8 +625,8 @@ FROM ( , subq_13.listing__created_at__extract_month , subq_13.listing__created_at__extract_week , subq_13.listing__created_at__extract_day - , subq_13.listing__created_at__extract_dayofweek - , subq_13.listing__created_at__extract_dayofyear + , subq_13.listing__created_at__extract_dow + , subq_13.listing__created_at__extract_doy , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -637,8 +637,8 @@ FROM ( , subq_13.ds__extract_month AS metric_time__extract_month , subq_13.ds__extract_week AS metric_time__extract_week , subq_13.ds__extract_day AS metric_time__extract_day - , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_13.ds__extract_dow AS metric_time__extract_dow + , subq_13.ds__extract_doy AS metric_time__extract_doy , subq_13.listing , subq_13.user , subq_13.listing__user @@ -662,25 +662,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -689,25 +689,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index 7bf9d04ee5..ad59db3e71 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,74 +47,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,25 +141,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,25 +168,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql index 2064e8d4a5..4d1af3e704 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql index b2502ec83f..539cd1c2ea 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql @@ -38,74 +38,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql index cc45bf1891..c60a8f1013 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql index d4dd5b361d..c2e7e2ba3a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql index 0f93debdc2..5690d18f05 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql @@ -23,8 +23,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -35,8 +35,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -61,25 +61,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql index 06c8ba798c..958cb5faa4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index b7e9032ac9..431635cda5 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql index 9e6b7ea463..f16e293fe0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC(revenue_src_10006.created_at, month) AS ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month , DATE_TRUNC(revenue_src_10006.created_at, quarter) AS company__ds__quarter , DATE_TRUNC(revenue_src_10006.created_at, year) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql index bfe2d094f8..2982019f1d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -266,8 +266,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -278,8 +278,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -290,8 +290,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -302,8 +302,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -338,8 +338,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -384,74 +384,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql index 9ca086a919..9b40278672 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 52d9d94da7..2ab4211e28 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql index 1b1449615b..b344f149a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 475e77c5dc..8028b1f148 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index f2aa5d7c8c..64d1c8125b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -373,8 +373,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -385,8 +385,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -397,8 +397,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -409,8 +409,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -433,8 +433,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -475,8 +475,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -487,8 +487,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -499,8 +499,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -511,8 +511,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -523,8 +523,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -535,8 +535,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -547,8 +547,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -593,74 +593,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index e057de623f..3bf4e0e3cd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -374,8 +374,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -386,8 +386,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -398,8 +398,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -410,8 +410,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -422,8 +422,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -434,8 +434,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -476,8 +476,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql index 7a120c1236..b6f236cde8 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_4.ds__extract_month AS ds__extract_month , subq_4.ds__extract_week AS ds__extract_week , subq_4.ds__extract_day AS ds__extract_day - , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_4.ds__extract_dow AS ds__extract_dow + , subq_4.ds__extract_doy AS ds__extract_doy , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_4.paid_at__extract_month AS paid_at__extract_month , subq_4.paid_at__extract_week AS paid_at__extract_week , subq_4.paid_at__extract_day AS paid_at__extract_day - , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_4.paid_at__extract_dow AS paid_at__extract_dow + , subq_4.paid_at__extract_doy AS paid_at__extract_doy , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_4.booking__ds__extract_month AS booking__ds__extract_month , subq_4.booking__ds__extract_week AS booking__ds__extract_week , subq_4.booking__ds__extract_day AS booking__ds__extract_day - , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_4.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_4.booking__ds__extract_doy AS booking__ds__extract_doy , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_4.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_4.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -135,8 +135,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -147,8 +147,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -159,8 +159,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -171,8 +171,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -183,8 +183,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -195,8 +195,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -206,8 +206,8 @@ FROM ( , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.metric_time__extract_week AS metric_time__extract_week , subq_1.metric_time__extract_day AS metric_time__extract_day - , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -248,8 +248,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -260,8 +260,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -272,8 +272,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -284,8 +284,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -296,8 +296,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -308,8 +308,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -320,8 +320,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -366,74 +366,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql index 19b237f759..4d754919c2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -134,8 +134,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -146,8 +146,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -158,8 +158,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -170,8 +170,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -206,8 +206,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -252,74 +252,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql index 95a9c68e3f..9373149736 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -59,8 +59,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -71,8 +71,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -83,8 +83,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -95,8 +95,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -107,8 +107,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,8 +119,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,74 +165,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -262,8 +262,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -274,8 +274,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -298,8 +298,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -310,8 +310,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -335,25 +335,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -362,25 +362,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql index 275f765347..84160306fc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql @@ -25,74 +25,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql index 4f0cd51ead..74d3cae54a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql index 298d60b12f..0352822f08 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -77,8 +77,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -89,8 +89,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,8 +125,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -171,74 +171,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -268,8 +268,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -280,8 +280,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -292,8 +292,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -316,8 +316,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -341,25 +341,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -368,25 +368,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql index 00a9252e55..1ebeb96fdf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql @@ -55,8 +55,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -67,8 +67,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -79,8 +79,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -103,8 +103,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -115,8 +115,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -127,8 +127,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -159,74 +159,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10015.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10015.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -255,25 +255,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -282,25 +282,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS listing__window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS listing__window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS listing__window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS listing__window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS listing__window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 16eb99e413..f40b5933ab 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql index fbeb26604f..bdb3b55b6b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql index 2162a5c2ad..f0523526b9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql index aa307ac3ae..8aac1294f0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql @@ -31,8 +31,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -43,8 +43,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -55,8 +55,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -67,8 +67,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -103,8 +103,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql index c02240d603..bc42027f9e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month @@ -38,8 +38,8 @@ FROM ( , subq_0.created_at__extract_month , subq_0.created_at__extract_week , subq_0.created_at__extract_day - , subq_0.created_at__extract_dayofweek - , subq_0.created_at__extract_dayofyear + , subq_0.created_at__extract_dow + , subq_0.created_at__extract_doy , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month @@ -50,8 +50,8 @@ FROM ( , subq_0.listing__ds__extract_month , subq_0.listing__ds__extract_week , subq_0.listing__ds__extract_day - , subq_0.listing__ds__extract_dayofweek - , subq_0.listing__ds__extract_dayofyear + , subq_0.listing__ds__extract_dow + , subq_0.listing__ds__extract_doy , subq_0.listing__created_at__day , subq_0.listing__created_at__week , subq_0.listing__created_at__month @@ -62,8 +62,8 @@ FROM ( , subq_0.listing__created_at__extract_month , subq_0.listing__created_at__extract_week , subq_0.listing__created_at__extract_day - , subq_0.listing__created_at__extract_dayofweek - , subq_0.listing__created_at__extract_dayofyear + , subq_0.listing__created_at__extract_dow + , subq_0.listing__created_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -74,8 +74,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.user , subq_0.listing__user @@ -99,25 +99,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -126,25 +126,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql index db653ee51c..7cffe26a94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql @@ -35,74 +35,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql index f83d1e53c7..451625b47c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql @@ -65,8 +65,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -89,8 +89,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -125,8 +125,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -137,8 +137,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -183,74 +183,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -280,8 +280,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -316,8 +316,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -328,8 +328,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -353,25 +353,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -380,25 +380,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -476,8 +476,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -691,8 +691,8 @@ FROM ( , subq_15.ds__extract_month , subq_15.ds__extract_week , subq_15.ds__extract_day - , subq_15.ds__extract_dayofweek - , subq_15.ds__extract_dayofyear + , subq_15.ds__extract_dow + , subq_15.ds__extract_doy , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month @@ -703,8 +703,8 @@ FROM ( , subq_15.created_at__extract_month , subq_15.created_at__extract_week , subq_15.created_at__extract_day - , subq_15.created_at__extract_dayofweek - , subq_15.created_at__extract_dayofyear + , subq_15.created_at__extract_dow + , subq_15.created_at__extract_doy , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month @@ -715,8 +715,8 @@ FROM ( , subq_15.listing__ds__extract_month , subq_15.listing__ds__extract_week , subq_15.listing__ds__extract_day - , subq_15.listing__ds__extract_dayofweek - , subq_15.listing__ds__extract_dayofyear + , subq_15.listing__ds__extract_dow + , subq_15.listing__ds__extract_doy , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month @@ -727,8 +727,8 @@ FROM ( , subq_15.listing__created_at__extract_month , subq_15.listing__created_at__extract_week , subq_15.listing__created_at__extract_day - , subq_15.listing__created_at__extract_dayofweek - , subq_15.listing__created_at__extract_dayofyear + , subq_15.listing__created_at__extract_dow + , subq_15.listing__created_at__extract_doy , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -739,8 +739,8 @@ FROM ( , subq_15.ds__extract_month AS metric_time__extract_month , subq_15.ds__extract_week AS metric_time__extract_week , subq_15.ds__extract_day AS metric_time__extract_day - , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_15.ds__extract_dow AS metric_time__extract_dow + , subq_15.ds__extract_doy AS metric_time__extract_doy , subq_15.listing , subq_15.user , subq_15.listing__user @@ -764,25 +764,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -791,25 +791,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -870,8 +870,8 @@ FROM ( , subq_24.ds__extract_month , subq_24.ds__extract_week , subq_24.ds__extract_day - , subq_24.ds__extract_dayofweek - , subq_24.ds__extract_dayofyear + , subq_24.ds__extract_dow + , subq_24.ds__extract_doy , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month @@ -882,8 +882,8 @@ FROM ( , subq_24.ds_partitioned__extract_month , subq_24.ds_partitioned__extract_week , subq_24.ds_partitioned__extract_day - , subq_24.ds_partitioned__extract_dayofweek - , subq_24.ds_partitioned__extract_dayofyear + , subq_24.ds_partitioned__extract_dow + , subq_24.ds_partitioned__extract_doy , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month @@ -894,8 +894,8 @@ FROM ( , subq_24.paid_at__extract_month , subq_24.paid_at__extract_week , subq_24.paid_at__extract_day - , subq_24.paid_at__extract_dayofweek - , subq_24.paid_at__extract_dayofyear + , subq_24.paid_at__extract_dow + , subq_24.paid_at__extract_doy , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month @@ -906,8 +906,8 @@ FROM ( , subq_24.booking__ds__extract_month , subq_24.booking__ds__extract_week , subq_24.booking__ds__extract_day - , subq_24.booking__ds__extract_dayofweek - , subq_24.booking__ds__extract_dayofyear + , subq_24.booking__ds__extract_dow + , subq_24.booking__ds__extract_doy , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month @@ -918,8 +918,8 @@ FROM ( , subq_24.booking__ds_partitioned__extract_month , subq_24.booking__ds_partitioned__extract_week , subq_24.booking__ds_partitioned__extract_day - , subq_24.booking__ds_partitioned__extract_dayofweek - , subq_24.booking__ds_partitioned__extract_dayofyear + , subq_24.booking__ds_partitioned__extract_dow + , subq_24.booking__ds_partitioned__extract_doy , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month @@ -930,8 +930,8 @@ FROM ( , subq_24.booking__paid_at__extract_month , subq_24.booking__paid_at__extract_week , subq_24.booking__paid_at__extract_day - , subq_24.booking__paid_at__extract_dayofweek - , subq_24.booking__paid_at__extract_dayofyear + , subq_24.booking__paid_at__extract_dow + , subq_24.booking__paid_at__extract_doy , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -942,8 +942,8 @@ FROM ( , subq_24.ds__extract_month AS metric_time__extract_month , subq_24.ds__extract_week AS metric_time__extract_week , subq_24.ds__extract_day AS metric_time__extract_day - , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_24.ds__extract_dow AS metric_time__extract_dow + , subq_24.ds__extract_doy AS metric_time__extract_doy , subq_24.listing , subq_24.guest , subq_24.host @@ -988,74 +988,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql index 28f70455e3..74ac44eb4b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -74,8 +74,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -86,8 +86,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,8 +122,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -168,74 +168,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -282,8 +282,8 @@ FROM ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month @@ -294,8 +294,8 @@ FROM ( , subq_7.ds_partitioned__extract_month , subq_7.ds_partitioned__extract_week , subq_7.ds_partitioned__extract_day - , subq_7.ds_partitioned__extract_dayofweek - , subq_7.ds_partitioned__extract_dayofyear + , subq_7.ds_partitioned__extract_dow + , subq_7.ds_partitioned__extract_doy , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month @@ -306,8 +306,8 @@ FROM ( , subq_7.paid_at__extract_month , subq_7.paid_at__extract_week , subq_7.paid_at__extract_day - , subq_7.paid_at__extract_dayofweek - , subq_7.paid_at__extract_dayofyear + , subq_7.paid_at__extract_dow + , subq_7.paid_at__extract_doy , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month @@ -318,8 +318,8 @@ FROM ( , subq_7.booking__ds__extract_month , subq_7.booking__ds__extract_week , subq_7.booking__ds__extract_day - , subq_7.booking__ds__extract_dayofweek - , subq_7.booking__ds__extract_dayofyear + , subq_7.booking__ds__extract_dow + , subq_7.booking__ds__extract_doy , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month @@ -330,8 +330,8 @@ FROM ( , subq_7.booking__ds_partitioned__extract_month , subq_7.booking__ds_partitioned__extract_week , subq_7.booking__ds_partitioned__extract_day - , subq_7.booking__ds_partitioned__extract_dayofweek - , subq_7.booking__ds_partitioned__extract_dayofyear + , subq_7.booking__ds_partitioned__extract_dow + , subq_7.booking__ds_partitioned__extract_doy , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month @@ -342,8 +342,8 @@ FROM ( , subq_7.booking__paid_at__extract_month , subq_7.booking__paid_at__extract_week , subq_7.booking__paid_at__extract_day - , subq_7.booking__paid_at__extract_dayofweek - , subq_7.booking__paid_at__extract_dayofyear + , subq_7.booking__paid_at__extract_dow + , subq_7.booking__paid_at__extract_doy , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -354,8 +354,8 @@ FROM ( , subq_7.ds__extract_month AS metric_time__extract_month , subq_7.ds__extract_week AS metric_time__extract_week , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -400,74 +400,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 933c4905c0..6afff7eaab 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -44,8 +44,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -56,8 +56,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -68,8 +68,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,8 +116,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -162,74 +162,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 3c83f6b210..e0d87aa819 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -256,8 +256,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month @@ -268,8 +268,8 @@ FROM ( , subq_5.created_at__extract_month , subq_5.created_at__extract_week , subq_5.created_at__extract_day - , subq_5.created_at__extract_dayofweek - , subq_5.created_at__extract_dayofyear + , subq_5.created_at__extract_dow + , subq_5.created_at__extract_doy , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month @@ -280,8 +280,8 @@ FROM ( , subq_5.listing__ds__extract_month , subq_5.listing__ds__extract_week , subq_5.listing__ds__extract_day - , subq_5.listing__ds__extract_dayofweek - , subq_5.listing__ds__extract_dayofyear + , subq_5.listing__ds__extract_dow + , subq_5.listing__ds__extract_doy , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_5.listing__created_at__extract_month , subq_5.listing__created_at__extract_week , subq_5.listing__created_at__extract_day - , subq_5.listing__created_at__extract_dayofweek - , subq_5.listing__created_at__extract_dayofyear + , subq_5.listing__created_at__extract_dow + , subq_5.listing__created_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -304,8 +304,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.user , subq_5.listing__user @@ -329,25 +329,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -356,25 +356,25 @@ FROM ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql index 9a8ead4f06..ba0780ad72 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10015.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10015.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -250,8 +250,8 @@ FROM ( , subq_3.window_start__extract_month AS window_start__extract_month , subq_3.window_start__extract_week AS window_start__extract_week , subq_3.window_start__extract_day AS window_start__extract_day - , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek - , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear + , subq_3.window_start__extract_dow AS window_start__extract_dow + , subq_3.window_start__extract_doy AS window_start__extract_doy , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month @@ -262,8 +262,8 @@ FROM ( , subq_3.window_end__extract_month AS window_end__extract_month , subq_3.window_end__extract_week AS window_end__extract_week , subq_3.window_end__extract_day AS window_end__extract_day - , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek - , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear + , subq_3.window_end__extract_dow AS window_end__extract_dow + , subq_3.window_end__extract_doy AS window_end__extract_doy , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month @@ -274,8 +274,8 @@ FROM ( , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day - , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek - , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_3.listing__window_start__extract_dow AS listing__window_start__extract_dow + , subq_3.listing__window_start__extract_doy AS listing__window_start__extract_doy , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day - , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek - , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_3.listing__window_end__extract_dow AS listing__window_end__extract_dow + , subq_3.listing__window_end__extract_doy AS listing__window_end__extract_doy , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month @@ -298,8 +298,8 @@ FROM ( , subq_5.ds__extract_month AS user__ds__extract_month , subq_5.ds__extract_week AS user__ds__extract_week , subq_5.ds__extract_day AS user__ds__extract_day - , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek - , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear + , subq_5.ds__extract_dow AS user__ds__extract_dow + , subq_5.ds__extract_doy AS user__ds__extract_doy , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -318,25 +318,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -345,25 +345,25 @@ FROM ( , DATE_TRUNC(listings_src_10017.active_from, month) AS listing__window_start__month , DATE_TRUNC(listings_src_10017.active_from, quarter) AS listing__window_start__quarter , DATE_TRUNC(listings_src_10017.active_from, year) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS listing__window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS listing__window_end__month , DATE_TRUNC(listings_src_10017.active_to, quarter) AS listing__window_end__quarter , DATE_TRUNC(listings_src_10017.active_to, year) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -412,8 +412,8 @@ FROM ( , subq_4.ds__extract_month , subq_4.ds__extract_week , subq_4.ds__extract_day - , subq_4.ds__extract_dayofweek - , subq_4.ds__extract_dayofyear + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month @@ -424,8 +424,8 @@ FROM ( , subq_4.user__ds__extract_month , subq_4.user__ds__extract_week , subq_4.user__ds__extract_day - , subq_4.user__ds__extract_dayofweek - , subq_4.user__ds__extract_dayofyear + , subq_4.user__ds__extract_dow + , subq_4.user__ds__extract_doy , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -437,26 +437,26 @@ FROM ( , DATE_TRUNC(users_latest_src_10021.ds, month) AS ds__month , DATE_TRUNC(users_latest_src_10021.ds, quarter) AS ds__quarter , DATE_TRUNC(users_latest_src_10021.ds, year) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC(users_latest_src_10021.ds, isoweek) AS user__ds__week , DATE_TRUNC(users_latest_src_10021.ds, month) AS user__ds__month , DATE_TRUNC(users_latest_src_10021.ds, quarter) AS user__ds__quarter , DATE_TRUNC(users_latest_src_10021.ds, year) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(ISOWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql index 2f2cded306..62d24b00ba 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10015.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10015.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10015.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10015.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10015.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10015.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -253,8 +253,8 @@ FROM ( , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day - , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek - , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear + , subq_5.window_start__extract_dow AS lux_listing__window_start__extract_dow + , subq_5.window_start__extract_doy AS lux_listing__window_start__extract_doy , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month @@ -265,8 +265,8 @@ FROM ( , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day - , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek - , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear + , subq_5.window_end__extract_dow AS lux_listing__window_end__extract_dow + , subq_5.window_end__extract_doy AS lux_listing__window_end__extract_doy , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -343,8 +343,8 @@ FROM ( , subq_4.window_start__extract_month , subq_4.window_start__extract_week , subq_4.window_start__extract_day - , subq_4.window_start__extract_dayofweek - , subq_4.window_start__extract_dayofyear + , subq_4.window_start__extract_dow + , subq_4.window_start__extract_doy , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month @@ -355,8 +355,8 @@ FROM ( , subq_4.window_end__extract_month , subq_4.window_end__extract_week , subq_4.window_end__extract_day - , subq_4.window_end__extract_dayofweek - , subq_4.window_end__extract_dayofyear + , subq_4.window_end__extract_dow + , subq_4.window_end__extract_doy , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month @@ -367,8 +367,8 @@ FROM ( , subq_4.lux_listing__window_start__extract_month , subq_4.lux_listing__window_start__extract_week , subq_4.lux_listing__window_start__extract_day - , subq_4.lux_listing__window_start__extract_dayofweek - , subq_4.lux_listing__window_start__extract_dayofyear + , subq_4.lux_listing__window_start__extract_dow + , subq_4.lux_listing__window_start__extract_doy , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month @@ -379,8 +379,8 @@ FROM ( , subq_4.lux_listing__window_end__extract_month , subq_4.lux_listing__window_end__extract_week , subq_4.lux_listing__window_end__extract_day - , subq_4.lux_listing__window_end__extract_dayofweek - , subq_4.lux_listing__window_end__extract_dayofyear + , subq_4.lux_listing__window_end__extract_dow + , subq_4.lux_listing__window_end__extract_doy , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -392,50 +392,50 @@ FROM ( , DATE_TRUNC(lux_listings_src_10019.valid_from, month) AS window_start__month , DATE_TRUNC(lux_listings_src_10019.valid_from, quarter) AS window_start__quarter , DATE_TRUNC(lux_listings_src_10019.valid_from, year) AS window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC(lux_listings_src_10019.valid_to, isoweek) AS window_end__week , DATE_TRUNC(lux_listings_src_10019.valid_to, month) AS window_end__month , DATE_TRUNC(lux_listings_src_10019.valid_to, quarter) AS window_end__quarter , DATE_TRUNC(lux_listings_src_10019.valid_to, year) AS window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC(lux_listings_src_10019.valid_from, isoweek) AS lux_listing__window_start__week , DATE_TRUNC(lux_listings_src_10019.valid_from, month) AS lux_listing__window_start__month , DATE_TRUNC(lux_listings_src_10019.valid_from, quarter) AS lux_listing__window_start__quarter , DATE_TRUNC(lux_listings_src_10019.valid_from, year) AS lux_listing__window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC(lux_listings_src_10019.valid_to, isoweek) AS lux_listing__window_end__week , DATE_TRUNC(lux_listings_src_10019.valid_to, month) AS lux_listing__window_end__month , DATE_TRUNC(lux_listings_src_10019.valid_to, quarter) AS lux_listing__window_end__quarter , DATE_TRUNC(lux_listings_src_10019.valid_to, year) AS lux_listing__window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql index 9c13f10eec..0b80e4d74f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql @@ -33,74 +33,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -127,25 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -154,25 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -201,25 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -228,25 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql index b0ede76214..7e7b3ab4ea 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.account_id__ds_partitioned__day , subq_0.account_id__ds_partitioned__week , subq_0.account_id__ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.account_id__ds_partitioned__extract_month , subq_0.account_id__ds_partitioned__extract_week , subq_0.account_id__ds_partitioned__extract_day - , subq_0.account_id__ds_partitioned__extract_dayofweek - , subq_0.account_id__ds_partitioned__extract_dayofyear + , subq_0.account_id__ds_partitioned__extract_dow + , subq_0.account_id__ds_partitioned__extract_doy , subq_0.account_id__ds__day , subq_0.account_id__ds__week , subq_0.account_id__ds__month @@ -77,8 +77,8 @@ FROM ( , subq_0.account_id__ds__extract_month , subq_0.account_id__ds__extract_week , subq_0.account_id__ds__extract_day - , subq_0.account_id__ds__extract_dayofweek - , subq_0.account_id__ds__extract_dayofyear + , subq_0.account_id__ds__extract_dow + , subq_0.account_id__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month @@ -104,50 +104,50 @@ FROM ( , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC(account_month_txns_src_10010.ds, isoweek) AS ds__week , DATE_TRUNC(account_month_txns_src_10010.ds, month) AS ds__month , DATE_TRUNC(account_month_txns_src_10010.ds, quarter) AS ds__quarter , DATE_TRUNC(account_month_txns_src_10010.ds, year) AS ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, isoweek) AS account_id__ds_partitioned__week , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, month) AS account_id__ds_partitioned__month , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, quarter) AS account_id__ds_partitioned__quarter , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, year) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC(account_month_txns_src_10010.ds, isoweek) AS account_id__ds__week , DATE_TRUNC(account_month_txns_src_10010.ds, month) AS account_id__ds__month , DATE_TRUNC(account_month_txns_src_10010.ds, quarter) AS account_id__ds__quarter , DATE_TRUNC(account_month_txns_src_10010.ds, year) AS account_id__ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -174,8 +174,8 @@ FROM ( , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_3.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_3.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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 @@ -186,8 +186,8 @@ FROM ( , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day - , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek - , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear + , subq_3.account_id__ds_partitioned__extract_dow AS account_id__ds_partitioned__extract_dow + , subq_3.account_id__ds_partitioned__extract_doy AS account_id__ds_partitioned__extract_doy , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month @@ -198,8 +198,8 @@ FROM ( , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow AS customer_id__ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy AS customer_id__ds_partitioned__extract_doy , 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 @@ -216,26 +216,26 @@ FROM ( , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, isoweek) AS account_id__ds_partitioned__week , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, month) AS account_id__ds_partitioned__month , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, quarter) AS account_id__ds_partitioned__quarter , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, year) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -283,8 +283,8 @@ FROM ( , subq_4.ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy , subq_4.customer_id__ds_partitioned__day , subq_4.customer_id__ds_partitioned__week , subq_4.customer_id__ds_partitioned__month @@ -295,8 +295,8 @@ FROM ( , subq_4.customer_id__ds_partitioned__extract_month , subq_4.customer_id__ds_partitioned__extract_week , subq_4.customer_id__ds_partitioned__extract_day - , subq_4.customer_id__ds_partitioned__extract_dayofweek - , subq_4.customer_id__ds_partitioned__extract_dayofyear + , subq_4.customer_id__ds_partitioned__extract_dow + , subq_4.customer_id__ds_partitioned__extract_doy , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -312,13 +312,13 @@ FROM ( , DATE_TRUNC(customer_table_src_10013.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(customer_table_src_10013.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(customer_table_src_10013.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -326,13 +326,13 @@ FROM ( , DATE_TRUNC(customer_table_src_10013.ds_partitioned, month) AS customer_id__ds_partitioned__month , DATE_TRUNC(customer_table_src_10013.ds_partitioned, quarter) AS customer_id__ds_partitioned__quarter , DATE_TRUNC(customer_table_src_10013.ds_partitioned, year) AS customer_id__ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql index 7a1160e719..83d7b73587 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql @@ -28,8 +28,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month @@ -40,8 +40,8 @@ FROM ( , subq_1.ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month @@ -52,8 +52,8 @@ FROM ( , subq_1.paid_at__extract_month , subq_1.paid_at__extract_week , subq_1.paid_at__extract_day - , subq_1.paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow + , subq_1.paid_at__extract_doy , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month @@ -64,8 +64,8 @@ FROM ( , subq_1.booking__ds__extract_month , subq_1.booking__ds__extract_week , subq_1.booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow + , subq_1.booking__ds__extract_doy , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month @@ -76,8 +76,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month @@ -88,8 +88,8 @@ FROM ( , subq_1.booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -100,8 +100,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.listing , subq_1.guest , subq_1.host @@ -136,8 +136,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -160,8 +160,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -172,8 +172,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -196,8 +196,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -208,8 +208,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -254,74 +254,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -362,8 +362,8 @@ CROSS JOIN ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month @@ -374,8 +374,8 @@ CROSS JOIN ( , subq_7.created_at__extract_month , subq_7.created_at__extract_week , subq_7.created_at__extract_day - , subq_7.created_at__extract_dayofweek - , subq_7.created_at__extract_dayofyear + , subq_7.created_at__extract_dow + , subq_7.created_at__extract_doy , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month @@ -386,8 +386,8 @@ CROSS JOIN ( , subq_7.listing__ds__extract_month , subq_7.listing__ds__extract_week , subq_7.listing__ds__extract_day - , subq_7.listing__ds__extract_dayofweek - , subq_7.listing__ds__extract_dayofyear + , subq_7.listing__ds__extract_dow + , subq_7.listing__ds__extract_doy , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month @@ -398,8 +398,8 @@ CROSS JOIN ( , subq_7.listing__created_at__extract_month , subq_7.listing__created_at__extract_week , subq_7.listing__created_at__extract_day - , subq_7.listing__created_at__extract_dayofweek - , subq_7.listing__created_at__extract_dayofyear + , subq_7.listing__created_at__extract_dow + , subq_7.listing__created_at__extract_doy , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -410,8 +410,8 @@ CROSS JOIN ( , subq_7.metric_time__extract_month , subq_7.metric_time__extract_week , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dayofweek - , subq_7.metric_time__extract_dayofyear + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.user , subq_7.listing__user @@ -437,8 +437,8 @@ CROSS JOIN ( , subq_6.ds__extract_month , subq_6.ds__extract_week , subq_6.ds__extract_day - , subq_6.ds__extract_dayofweek - , subq_6.ds__extract_dayofyear + , subq_6.ds__extract_dow + , subq_6.ds__extract_doy , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month @@ -449,8 +449,8 @@ CROSS JOIN ( , subq_6.created_at__extract_month , subq_6.created_at__extract_week , subq_6.created_at__extract_day - , subq_6.created_at__extract_dayofweek - , subq_6.created_at__extract_dayofyear + , subq_6.created_at__extract_dow + , subq_6.created_at__extract_doy , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month @@ -461,8 +461,8 @@ CROSS JOIN ( , subq_6.listing__ds__extract_month , subq_6.listing__ds__extract_week , subq_6.listing__ds__extract_day - , subq_6.listing__ds__extract_dayofweek - , subq_6.listing__ds__extract_dayofyear + , subq_6.listing__ds__extract_dow + , subq_6.listing__ds__extract_doy , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month @@ -473,8 +473,8 @@ CROSS JOIN ( , subq_6.listing__created_at__extract_month , subq_6.listing__created_at__extract_week , subq_6.listing__created_at__extract_day - , subq_6.listing__created_at__extract_dayofweek - , subq_6.listing__created_at__extract_dayofyear + , subq_6.listing__created_at__extract_dow + , subq_6.listing__created_at__extract_doy , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -485,8 +485,8 @@ CROSS JOIN ( , subq_6.ds__extract_month AS metric_time__extract_month , subq_6.ds__extract_week AS metric_time__extract_week , subq_6.ds__extract_day AS metric_time__extract_day - , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_6.ds__extract_dow AS metric_time__extract_dow + , subq_6.ds__extract_doy AS metric_time__extract_doy , subq_6.listing , subq_6.user , subq_6.listing__user @@ -510,25 +510,25 @@ CROSS JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -537,25 +537,25 @@ CROSS JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql index 530e65ec20..9037a9f0bb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql @@ -49,8 +49,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -73,8 +73,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -109,8 +109,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -121,8 +121,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -167,74 +167,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -278,8 +278,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -290,8 +290,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -302,8 +302,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -338,8 +338,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -350,8 +350,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -396,74 +396,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -519,8 +519,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -531,8 +531,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -543,8 +543,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -555,8 +555,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -567,8 +567,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -579,8 +579,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -591,8 +591,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -637,74 +637,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -758,8 +758,8 @@ FROM ( , subq_17.ds__extract_month , subq_17.ds__extract_week , subq_17.ds__extract_day - , subq_17.ds__extract_dayofweek - , subq_17.ds__extract_dayofyear + , subq_17.ds__extract_dow + , subq_17.ds__extract_doy , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month @@ -770,8 +770,8 @@ FROM ( , subq_17.ds_partitioned__extract_month , subq_17.ds_partitioned__extract_week , subq_17.ds_partitioned__extract_day - , subq_17.ds_partitioned__extract_dayofweek - , subq_17.ds_partitioned__extract_dayofyear + , subq_17.ds_partitioned__extract_dow + , subq_17.ds_partitioned__extract_doy , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month @@ -782,8 +782,8 @@ FROM ( , subq_17.paid_at__extract_month , subq_17.paid_at__extract_week , subq_17.paid_at__extract_day - , subq_17.paid_at__extract_dayofweek - , subq_17.paid_at__extract_dayofyear + , subq_17.paid_at__extract_dow + , subq_17.paid_at__extract_doy , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month @@ -794,8 +794,8 @@ FROM ( , subq_17.booking__ds__extract_month , subq_17.booking__ds__extract_week , subq_17.booking__ds__extract_day - , subq_17.booking__ds__extract_dayofweek - , subq_17.booking__ds__extract_dayofyear + , subq_17.booking__ds__extract_dow + , subq_17.booking__ds__extract_doy , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month @@ -806,8 +806,8 @@ FROM ( , subq_17.booking__ds_partitioned__extract_month , subq_17.booking__ds_partitioned__extract_week , subq_17.booking__ds_partitioned__extract_day - , subq_17.booking__ds_partitioned__extract_dayofweek - , subq_17.booking__ds_partitioned__extract_dayofyear + , subq_17.booking__ds_partitioned__extract_dow + , subq_17.booking__ds_partitioned__extract_doy , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month @@ -818,8 +818,8 @@ FROM ( , subq_17.booking__paid_at__extract_month , subq_17.booking__paid_at__extract_week , subq_17.booking__paid_at__extract_day - , subq_17.booking__paid_at__extract_dayofweek - , subq_17.booking__paid_at__extract_dayofyear + , subq_17.booking__paid_at__extract_dow + , subq_17.booking__paid_at__extract_doy , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -830,8 +830,8 @@ FROM ( , subq_17.ds__extract_month AS metric_time__extract_month , subq_17.ds__extract_week AS metric_time__extract_week , subq_17.ds__extract_day AS metric_time__extract_day - , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_17.ds__extract_dow AS metric_time__extract_dow + , subq_17.ds__extract_doy AS metric_time__extract_doy , subq_17.listing , subq_17.guest , subq_17.host @@ -876,74 +876,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql index 6fe53f5780..61c29db82f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql @@ -45,74 +45,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql index ce7f3ffa85..2fff30c78d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month @@ -65,8 +65,8 @@ FROM ( , subq_0.verification__ds__extract_month , subq_0.verification__ds__extract_week , subq_0.verification__ds__extract_day - , subq_0.verification__ds__extract_dayofweek - , subq_0.verification__ds__extract_dayofyear + , subq_0.verification__ds__extract_dow + , subq_0.verification__ds__extract_doy , subq_0.verification__ds_partitioned__day , subq_0.verification__ds_partitioned__week , subq_0.verification__ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.verification__ds_partitioned__extract_month , subq_0.verification__ds_partitioned__extract_week , subq_0.verification__ds_partitioned__extract_day - , subq_0.verification__ds_partitioned__extract_dayofweek - , subq_0.verification__ds_partitioned__extract_dayofyear + , subq_0.verification__ds_partitioned__extract_dow + , subq_0.verification__ds_partitioned__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.verification , subq_0.user , subq_0.verification__user @@ -106,50 +106,50 @@ FROM ( , DATE_TRUNC(id_verifications_src_10003.ds, month) AS ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week , DATE_TRUNC(id_verifications_src_10003.ds, month) AS verification__ds__month , DATE_TRUNC(id_verifications_src_10003.ds, quarter) AS verification__ds__quarter , DATE_TRUNC(id_verifications_src_10003.ds, year) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, quarter) AS verification__ds_partitioned__quarter , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, year) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -173,74 +173,74 @@ FROM ( , DATE_TRUNC(users_ds_source_src_10007.ds, month) AS ds__month , DATE_TRUNC(users_ds_source_src_10007.ds, quarter) AS ds__quarter , DATE_TRUNC(users_ds_source_src_10007.ds, year) AS ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC(users_ds_source_src_10007.created_at, isoweek) AS created_at__week , DATE_TRUNC(users_ds_source_src_10007.created_at, month) AS created_at__month , DATE_TRUNC(users_ds_source_src_10007.created_at, quarter) AS created_at__quarter , DATE_TRUNC(users_ds_source_src_10007.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC(users_ds_source_src_10007.ds, isoweek) AS user__ds__week , DATE_TRUNC(users_ds_source_src_10007.ds, month) AS user__ds__month , DATE_TRUNC(users_ds_source_src_10007.ds, quarter) AS user__ds__quarter , DATE_TRUNC(users_ds_source_src_10007.ds, year) AS user__ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC(users_ds_source_src_10007.created_at, isoweek) AS user__created_at__week , DATE_TRUNC(users_ds_source_src_10007.created_at, month) AS user__created_at__month , DATE_TRUNC(users_ds_source_src_10007.created_at, quarter) AS user__created_at__quarter , DATE_TRUNC(users_ds_source_src_10007.created_at, year) AS user__created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, isoweek) AS user__ds_partitioned__week , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, month) AS user__ds_partitioned__month , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, quarter) AS user__ds_partitioned__quarter , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, year) AS user__ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql index febccc91aa..791d0d4049 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -82,26 +82,26 @@ INNER JOIN ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql index 17d01a31fc..0f94ea6726 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week , DATE_TRUNC(ds, month) AS account__ds__month , DATE_TRUNC(ds, quarter) AS account__ds__quarter , DATE_TRUNC(ds, year) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql index cc5ef6ef07..1e815dd2dc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 8fbb61349d..a25638e888 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week , DATE_TRUNC(ds, month) AS account__ds__month , DATE_TRUNC(ds, quarter) AS account__ds__quarter , DATE_TRUNC(ds, year) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql index ab91ef4285..de371ca618 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC(accounts_source_src_10000.ds, month) AS ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week , DATE_TRUNC(accounts_source_src_10000.ds, month) AS account__ds__month , DATE_TRUNC(accounts_source_src_10000.ds, quarter) AS account__ds__quarter , DATE_TRUNC(accounts_source_src_10000.ds, year) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index c1a7811068..35af81c4d7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week , DATE_TRUNC(ds, month) AS account__ds__month , DATE_TRUNC(ds, quarter) AS account__ds__quarter , DATE_TRUNC(ds, year) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql index 2f7370d5ba..794337f673 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -125,25 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -152,25 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__ds__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__ds__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month , DATE_TRUNC(listings_latest_src_10004.created_at, quarter) AS listing__created_at__quarter , DATE_TRUNC(listings_latest_src_10004.created_at, year) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql index 2f0a3bb53b..28daacf7ef 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql index d68f494296..b6c163b9eb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month , DATE_TRUNC(paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month , DATE_TRUNC(ds, quarter) AS booking__ds__quarter , DATE_TRUNC(ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month , DATE_TRUNC(paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql index e98764d3a8..b954d8927e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_common_semantic_model__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -379,74 +379,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql index 9ddc5fe579..b1bf877e84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 83df46b3c4..5373f3b9a9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -56,8 +56,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -68,8 +68,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -80,8 +80,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -116,8 +116,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -128,8 +128,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -174,74 +174,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -271,8 +271,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -283,8 +283,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -295,8 +295,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -307,8 +307,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -319,8 +319,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -344,25 +344,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,25 +371,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -455,8 +455,8 @@ FROM ( , subq_10.ds__extract_month , subq_10.ds__extract_week , subq_10.ds__extract_day - , subq_10.ds__extract_dayofweek - , subq_10.ds__extract_dayofyear + , subq_10.ds__extract_dow + , subq_10.ds__extract_doy , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month @@ -467,8 +467,8 @@ FROM ( , subq_10.ds_partitioned__extract_month , subq_10.ds_partitioned__extract_week , subq_10.ds_partitioned__extract_day - , subq_10.ds_partitioned__extract_dayofweek - , subq_10.ds_partitioned__extract_dayofyear + , subq_10.ds_partitioned__extract_dow + , subq_10.ds_partitioned__extract_doy , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month @@ -479,8 +479,8 @@ FROM ( , subq_10.view__ds__extract_month , subq_10.view__ds__extract_week , subq_10.view__ds__extract_day - , subq_10.view__ds__extract_dayofweek - , subq_10.view__ds__extract_dayofyear + , subq_10.view__ds__extract_dow + , subq_10.view__ds__extract_doy , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month @@ -491,8 +491,8 @@ FROM ( , subq_10.view__ds_partitioned__extract_month , subq_10.view__ds_partitioned__extract_week , subq_10.view__ds_partitioned__extract_day - , subq_10.view__ds_partitioned__extract_dayofweek - , subq_10.view__ds_partitioned__extract_dayofyear + , subq_10.view__ds_partitioned__extract_dow + , subq_10.view__ds_partitioned__extract_doy , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -503,8 +503,8 @@ FROM ( , subq_10.ds__extract_month AS metric_time__extract_month , subq_10.ds__extract_week AS metric_time__extract_week , subq_10.ds__extract_day AS metric_time__extract_day - , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_10.ds__extract_dow AS metric_time__extract_dow + , subq_10.ds__extract_doy AS metric_time__extract_doy , subq_10.listing , subq_10.user , subq_10.view__listing @@ -519,49 +519,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM views_source_src_10009.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek - , EXTRACT(DOY FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -589,8 +589,8 @@ FROM ( , subq_13.ds__extract_month , subq_13.ds__extract_week , subq_13.ds__extract_day - , subq_13.ds__extract_dayofweek - , subq_13.ds__extract_dayofyear + , subq_13.ds__extract_dow + , subq_13.ds__extract_doy , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month @@ -601,8 +601,8 @@ FROM ( , subq_13.created_at__extract_month , subq_13.created_at__extract_week , subq_13.created_at__extract_day - , subq_13.created_at__extract_dayofweek - , subq_13.created_at__extract_dayofyear + , subq_13.created_at__extract_dow + , subq_13.created_at__extract_doy , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month @@ -613,8 +613,8 @@ FROM ( , subq_13.listing__ds__extract_month , subq_13.listing__ds__extract_week , subq_13.listing__ds__extract_day - , subq_13.listing__ds__extract_dayofweek - , subq_13.listing__ds__extract_dayofyear + , subq_13.listing__ds__extract_dow + , subq_13.listing__ds__extract_doy , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month @@ -625,8 +625,8 @@ FROM ( , subq_13.listing__created_at__extract_month , subq_13.listing__created_at__extract_week , subq_13.listing__created_at__extract_day - , subq_13.listing__created_at__extract_dayofweek - , subq_13.listing__created_at__extract_dayofyear + , subq_13.listing__created_at__extract_dow + , subq_13.listing__created_at__extract_doy , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -637,8 +637,8 @@ FROM ( , subq_13.ds__extract_month AS metric_time__extract_month , subq_13.ds__extract_week AS metric_time__extract_week , subq_13.ds__extract_day AS metric_time__extract_day - , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_13.ds__extract_dow AS metric_time__extract_dow + , subq_13.ds__extract_doy AS metric_time__extract_doy , subq_13.listing , subq_13.user , subq_13.listing__user @@ -662,25 +662,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -689,25 +689,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index f47fd76de7..1bd176c115 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,74 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,25 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,25 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql index 3eb622fa49..cd879426f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql index 2b0077fe9a..5b6dd99cc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_constrain_time_range_node__plan0.sql @@ -38,74 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql index 5dd2138c23..6920a36691 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql index 33a5834e5f..4080ab9420 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_grain_to_date__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql index 12219e1521..fcf74a5947 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_ds__plan0.sql @@ -23,8 +23,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -35,8 +35,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -61,25 +61,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql index bcac8fdcad..0143335613 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 61a5f71588..5cba3a3202 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql index 7c4b4abfb3..414159089b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_cumulative_metric_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DOY FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql index 24eacc8f9e..5b4011175d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -266,8 +266,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -278,8 +278,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -290,8 +290,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -302,8 +302,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -338,8 +338,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -384,74 +384,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql index bf72a9c59a..d11a69936d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index cdf5e6646b..b98d6d0f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql index 5c396371e8..9139bc862d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 7b2c9a7661..0022a4f526 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index f635bf528d..10bb6c0450 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -373,8 +373,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -385,8 +385,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -397,8 +397,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -409,8 +409,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -433,8 +433,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -475,8 +475,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -487,8 +487,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -499,8 +499,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -511,8 +511,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -523,8 +523,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -535,8 +535,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -547,8 +547,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -593,74 +593,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index c61f320f56..1aaa96b40a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -374,8 +374,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -386,8 +386,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -398,8 +398,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -410,8 +410,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -422,8 +422,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -434,8 +434,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -476,8 +476,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql index 35a55ef78b..3107752f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_cumulative_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_4.ds__extract_month AS ds__extract_month , subq_4.ds__extract_week AS ds__extract_week , subq_4.ds__extract_day AS ds__extract_day - , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_4.ds__extract_dow AS ds__extract_dow + , subq_4.ds__extract_doy AS ds__extract_doy , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_4.paid_at__extract_month AS paid_at__extract_month , subq_4.paid_at__extract_week AS paid_at__extract_week , subq_4.paid_at__extract_day AS paid_at__extract_day - , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_4.paid_at__extract_dow AS paid_at__extract_dow + , subq_4.paid_at__extract_doy AS paid_at__extract_doy , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_4.booking__ds__extract_month AS booking__ds__extract_month , subq_4.booking__ds__extract_week AS booking__ds__extract_week , subq_4.booking__ds__extract_day AS booking__ds__extract_day - , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_4.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_4.booking__ds__extract_doy AS booking__ds__extract_doy , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_4.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_4.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -135,8 +135,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -147,8 +147,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -159,8 +159,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -171,8 +171,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -183,8 +183,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -195,8 +195,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -206,8 +206,8 @@ FROM ( , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.metric_time__extract_week AS metric_time__extract_week , subq_1.metric_time__extract_day AS metric_time__extract_day - , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -248,8 +248,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -260,8 +260,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -272,8 +272,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -284,8 +284,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -296,8 +296,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -308,8 +308,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -320,8 +320,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -366,74 +366,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql index 4546c94c68..666e2d3376 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -134,8 +134,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -146,8 +146,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -158,8 +158,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -170,8 +170,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -206,8 +206,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -252,74 +252,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql index d4f664fec9..40f6785af3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_distinct_values__plan0.sql @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -59,8 +59,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -71,8 +71,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -83,8 +83,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -95,8 +95,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -107,8 +107,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,8 +119,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,74 +165,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -262,8 +262,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -274,8 +274,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -298,8 +298,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -310,8 +310,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -335,25 +335,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -362,25 +362,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql index ceb7438a40..a43457fcbd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_node__plan0.sql @@ -25,74 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql index 95f3b7ed5a..a3ce23fb89 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql index 8b1ab2a969..70919d8caa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -77,8 +77,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -89,8 +89,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,8 +125,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -171,74 +171,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -268,8 +268,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -280,8 +280,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -292,8 +292,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -316,8 +316,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -341,25 +341,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -368,25 +368,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql index 0d0160478b..6e4488a729 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_scd_dimension__plan0.sql @@ -55,8 +55,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -67,8 +67,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -79,8 +79,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -103,8 +103,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -115,8 +115,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -127,8 +127,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -159,74 +159,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -255,25 +255,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -282,25 +282,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 9f0330a8c4..9f23719b49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql index a66f5d9a1e..1c6b0467ff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql index 71b77eaf66..2093e49b0b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_join_to_time_spine_node_without_offset__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql index 3ba23c2e5a..eb506ddf59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_limit_rows__plan0.sql @@ -31,8 +31,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -43,8 +43,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -55,8 +55,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -67,8 +67,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -103,8 +103,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql index 2635220d21..d5688f0e2d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_local_dimension_using_local_entity__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month @@ -38,8 +38,8 @@ FROM ( , subq_0.created_at__extract_month , subq_0.created_at__extract_week , subq_0.created_at__extract_day - , subq_0.created_at__extract_dayofweek - , subq_0.created_at__extract_dayofyear + , subq_0.created_at__extract_dow + , subq_0.created_at__extract_doy , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month @@ -50,8 +50,8 @@ FROM ( , subq_0.listing__ds__extract_month , subq_0.listing__ds__extract_week , subq_0.listing__ds__extract_day - , subq_0.listing__ds__extract_dayofweek - , subq_0.listing__ds__extract_dayofyear + , subq_0.listing__ds__extract_dow + , subq_0.listing__ds__extract_doy , subq_0.listing__created_at__day , subq_0.listing__created_at__week , subq_0.listing__created_at__month @@ -62,8 +62,8 @@ FROM ( , subq_0.listing__created_at__extract_month , subq_0.listing__created_at__extract_week , subq_0.listing__created_at__extract_day - , subq_0.listing__created_at__extract_dayofweek - , subq_0.listing__created_at__extract_dayofyear + , subq_0.listing__created_at__extract_dow + , subq_0.listing__created_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -74,8 +74,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.user , subq_0.listing__user @@ -99,25 +99,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -126,25 +126,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql index 97140fd5a8..dbfcb34b94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_aggregation_node__plan0.sql @@ -35,74 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql index a3dc672f7f..e5349b0d17 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint__plan0.sql @@ -65,8 +65,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -89,8 +89,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -125,8 +125,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -137,8 +137,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -183,74 +183,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -280,8 +280,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -316,8 +316,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -328,8 +328,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -353,25 +353,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -380,25 +380,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -476,8 +476,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -691,8 +691,8 @@ FROM ( , subq_15.ds__extract_month , subq_15.ds__extract_week , subq_15.ds__extract_day - , subq_15.ds__extract_dayofweek - , subq_15.ds__extract_dayofyear + , subq_15.ds__extract_dow + , subq_15.ds__extract_doy , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month @@ -703,8 +703,8 @@ FROM ( , subq_15.created_at__extract_month , subq_15.created_at__extract_week , subq_15.created_at__extract_day - , subq_15.created_at__extract_dayofweek - , subq_15.created_at__extract_dayofyear + , subq_15.created_at__extract_dow + , subq_15.created_at__extract_doy , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month @@ -715,8 +715,8 @@ FROM ( , subq_15.listing__ds__extract_month , subq_15.listing__ds__extract_week , subq_15.listing__ds__extract_day - , subq_15.listing__ds__extract_dayofweek - , subq_15.listing__ds__extract_dayofyear + , subq_15.listing__ds__extract_dow + , subq_15.listing__ds__extract_doy , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month @@ -727,8 +727,8 @@ FROM ( , subq_15.listing__created_at__extract_month , subq_15.listing__created_at__extract_week , subq_15.listing__created_at__extract_day - , subq_15.listing__created_at__extract_dayofweek - , subq_15.listing__created_at__extract_dayofyear + , subq_15.listing__created_at__extract_dow + , subq_15.listing__created_at__extract_doy , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -739,8 +739,8 @@ FROM ( , subq_15.ds__extract_month AS metric_time__extract_month , subq_15.ds__extract_week AS metric_time__extract_week , subq_15.ds__extract_day AS metric_time__extract_day - , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_15.ds__extract_dow AS metric_time__extract_dow + , subq_15.ds__extract_doy AS metric_time__extract_doy , subq_15.listing , subq_15.user , subq_15.listing__user @@ -764,25 +764,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -791,25 +791,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -870,8 +870,8 @@ FROM ( , subq_24.ds__extract_month , subq_24.ds__extract_week , subq_24.ds__extract_day - , subq_24.ds__extract_dayofweek - , subq_24.ds__extract_dayofyear + , subq_24.ds__extract_dow + , subq_24.ds__extract_doy , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month @@ -882,8 +882,8 @@ FROM ( , subq_24.ds_partitioned__extract_month , subq_24.ds_partitioned__extract_week , subq_24.ds_partitioned__extract_day - , subq_24.ds_partitioned__extract_dayofweek - , subq_24.ds_partitioned__extract_dayofyear + , subq_24.ds_partitioned__extract_dow + , subq_24.ds_partitioned__extract_doy , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month @@ -894,8 +894,8 @@ FROM ( , subq_24.paid_at__extract_month , subq_24.paid_at__extract_week , subq_24.paid_at__extract_day - , subq_24.paid_at__extract_dayofweek - , subq_24.paid_at__extract_dayofyear + , subq_24.paid_at__extract_dow + , subq_24.paid_at__extract_doy , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month @@ -906,8 +906,8 @@ FROM ( , subq_24.booking__ds__extract_month , subq_24.booking__ds__extract_week , subq_24.booking__ds__extract_day - , subq_24.booking__ds__extract_dayofweek - , subq_24.booking__ds__extract_dayofyear + , subq_24.booking__ds__extract_dow + , subq_24.booking__ds__extract_doy , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month @@ -918,8 +918,8 @@ FROM ( , subq_24.booking__ds_partitioned__extract_month , subq_24.booking__ds_partitioned__extract_week , subq_24.booking__ds_partitioned__extract_day - , subq_24.booking__ds_partitioned__extract_dayofweek - , subq_24.booking__ds_partitioned__extract_dayofyear + , subq_24.booking__ds_partitioned__extract_dow + , subq_24.booking__ds_partitioned__extract_doy , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month @@ -930,8 +930,8 @@ FROM ( , subq_24.booking__paid_at__extract_month , subq_24.booking__paid_at__extract_week , subq_24.booking__paid_at__extract_day - , subq_24.booking__paid_at__extract_dayofweek - , subq_24.booking__paid_at__extract_dayofyear + , subq_24.booking__paid_at__extract_dow + , subq_24.booking__paid_at__extract_doy , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -942,8 +942,8 @@ FROM ( , subq_24.ds__extract_month AS metric_time__extract_month , subq_24.ds__extract_week AS metric_time__extract_week , subq_24.ds__extract_day AS metric_time__extract_day - , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_24.ds__extract_dow AS metric_time__extract_dow + , subq_24.ds__extract_doy AS metric_time__extract_doy , subq_24.listing , subq_24.guest , subq_24.host @@ -988,74 +988,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql index 2de235aece..c11754db0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_reused_measure__plan0.sql @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -74,8 +74,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -86,8 +86,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,8 +122,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -168,74 +168,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -282,8 +282,8 @@ FROM ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month @@ -294,8 +294,8 @@ FROM ( , subq_7.ds_partitioned__extract_month , subq_7.ds_partitioned__extract_week , subq_7.ds_partitioned__extract_day - , subq_7.ds_partitioned__extract_dayofweek - , subq_7.ds_partitioned__extract_dayofyear + , subq_7.ds_partitioned__extract_dow + , subq_7.ds_partitioned__extract_doy , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month @@ -306,8 +306,8 @@ FROM ( , subq_7.paid_at__extract_month , subq_7.paid_at__extract_week , subq_7.paid_at__extract_day - , subq_7.paid_at__extract_dayofweek - , subq_7.paid_at__extract_dayofyear + , subq_7.paid_at__extract_dow + , subq_7.paid_at__extract_doy , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month @@ -318,8 +318,8 @@ FROM ( , subq_7.booking__ds__extract_month , subq_7.booking__ds__extract_week , subq_7.booking__ds__extract_day - , subq_7.booking__ds__extract_dayofweek - , subq_7.booking__ds__extract_dayofyear + , subq_7.booking__ds__extract_dow + , subq_7.booking__ds__extract_doy , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month @@ -330,8 +330,8 @@ FROM ( , subq_7.booking__ds_partitioned__extract_month , subq_7.booking__ds_partitioned__extract_week , subq_7.booking__ds_partitioned__extract_day - , subq_7.booking__ds_partitioned__extract_dayofweek - , subq_7.booking__ds_partitioned__extract_dayofyear + , subq_7.booking__ds_partitioned__extract_dow + , subq_7.booking__ds_partitioned__extract_doy , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month @@ -342,8 +342,8 @@ FROM ( , subq_7.booking__paid_at__extract_month , subq_7.booking__paid_at__extract_week , subq_7.booking__paid_at__extract_day - , subq_7.booking__paid_at__extract_dayofweek - , subq_7.booking__paid_at__extract_dayofyear + , subq_7.booking__paid_at__extract_dow + , subq_7.booking__paid_at__extract_doy , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -354,8 +354,8 @@ FROM ( , subq_7.ds__extract_month AS metric_time__extract_month , subq_7.ds__extract_week AS metric_time__extract_week , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -400,74 +400,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 5c4bf2859d..bd41d48bd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -44,8 +44,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -56,8 +56,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -68,8 +68,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,8 +116,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -162,74 +162,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index b75797d1e3..ecc15101fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -256,8 +256,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month @@ -268,8 +268,8 @@ FROM ( , subq_5.created_at__extract_month , subq_5.created_at__extract_week , subq_5.created_at__extract_day - , subq_5.created_at__extract_dayofweek - , subq_5.created_at__extract_dayofyear + , subq_5.created_at__extract_dow + , subq_5.created_at__extract_doy , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month @@ -280,8 +280,8 @@ FROM ( , subq_5.listing__ds__extract_month , subq_5.listing__ds__extract_week , subq_5.listing__ds__extract_day - , subq_5.listing__ds__extract_dayofweek - , subq_5.listing__ds__extract_dayofyear + , subq_5.listing__ds__extract_dow + , subq_5.listing__ds__extract_doy , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_5.listing__created_at__extract_month , subq_5.listing__created_at__extract_week , subq_5.listing__created_at__extract_day - , subq_5.listing__created_at__extract_dayofweek - , subq_5.listing__created_at__extract_dayofyear + , subq_5.listing__created_at__extract_dow + , subq_5.listing__created_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -304,8 +304,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.user , subq_5.listing__user @@ -329,25 +329,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -356,25 +356,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql index 8430dbca74..d1740a6a39 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -250,8 +250,8 @@ FROM ( , subq_3.window_start__extract_month AS window_start__extract_month , subq_3.window_start__extract_week AS window_start__extract_week , subq_3.window_start__extract_day AS window_start__extract_day - , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek - , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear + , subq_3.window_start__extract_dow AS window_start__extract_dow + , subq_3.window_start__extract_doy AS window_start__extract_doy , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month @@ -262,8 +262,8 @@ FROM ( , subq_3.window_end__extract_month AS window_end__extract_month , subq_3.window_end__extract_week AS window_end__extract_week , subq_3.window_end__extract_day AS window_end__extract_day - , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek - , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear + , subq_3.window_end__extract_dow AS window_end__extract_dow + , subq_3.window_end__extract_doy AS window_end__extract_doy , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month @@ -274,8 +274,8 @@ FROM ( , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day - , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek - , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_3.listing__window_start__extract_dow AS listing__window_start__extract_dow + , subq_3.listing__window_start__extract_doy AS listing__window_start__extract_doy , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day - , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek - , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_3.listing__window_end__extract_dow AS listing__window_end__extract_dow + , subq_3.listing__window_end__extract_doy AS listing__window_end__extract_doy , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month @@ -298,8 +298,8 @@ FROM ( , subq_5.ds__extract_month AS user__ds__extract_month , subq_5.ds__extract_week AS user__ds__extract_week , subq_5.ds__extract_day AS user__ds__extract_day - , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek - , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear + , subq_5.ds__extract_dow AS user__ds__extract_dow + , subq_5.ds__extract_doy AS user__ds__extract_doy , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -318,25 +318,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -345,25 +345,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DOY FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -412,8 +412,8 @@ FROM ( , subq_4.ds__extract_month , subq_4.ds__extract_week , subq_4.ds__extract_day - , subq_4.ds__extract_dayofweek - , subq_4.ds__extract_dayofyear + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month @@ -424,8 +424,8 @@ FROM ( , subq_4.user__ds__extract_month , subq_4.user__ds__extract_week , subq_4.user__ds__extract_day - , subq_4.user__ds__extract_dayofweek - , subq_4.user__ds__extract_dayofyear + , subq_4.user__ds__extract_dow + , subq_4.user__ds__extract_doy , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -437,26 +437,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM users_latest_src_10021.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek - , EXTRACT(DOY FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql index 8d8a7b2fed..8abc633b9a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -253,8 +253,8 @@ FROM ( , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day - , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek - , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear + , subq_5.window_start__extract_dow AS lux_listing__window_start__extract_dow + , subq_5.window_start__extract_doy AS lux_listing__window_start__extract_doy , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month @@ -265,8 +265,8 @@ FROM ( , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day - , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek - , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear + , subq_5.window_end__extract_dow AS lux_listing__window_end__extract_dow + , subq_5.window_end__extract_doy AS lux_listing__window_end__extract_doy , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -343,8 +343,8 @@ FROM ( , subq_4.window_start__extract_month , subq_4.window_start__extract_week , subq_4.window_start__extract_day - , subq_4.window_start__extract_dayofweek - , subq_4.window_start__extract_dayofyear + , subq_4.window_start__extract_dow + , subq_4.window_start__extract_doy , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month @@ -355,8 +355,8 @@ FROM ( , subq_4.window_end__extract_month , subq_4.window_end__extract_week , subq_4.window_end__extract_day - , subq_4.window_end__extract_dayofweek - , subq_4.window_end__extract_dayofyear + , subq_4.window_end__extract_dow + , subq_4.window_end__extract_doy , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month @@ -367,8 +367,8 @@ FROM ( , subq_4.lux_listing__window_start__extract_month , subq_4.lux_listing__window_start__extract_week , subq_4.lux_listing__window_start__extract_day - , subq_4.lux_listing__window_start__extract_dayofweek - , subq_4.lux_listing__window_start__extract_dayofyear + , subq_4.lux_listing__window_start__extract_dow + , subq_4.lux_listing__window_start__extract_doy , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month @@ -379,8 +379,8 @@ FROM ( , subq_4.lux_listing__window_end__extract_month , subq_4.lux_listing__window_end__extract_week , subq_4.lux_listing__window_end__extract_day - , subq_4.lux_listing__window_end__extract_dayofweek - , subq_4.lux_listing__window_end__extract_dayofyear + , subq_4.lux_listing__window_end__extract_dow + , subq_4.lux_listing__window_end__extract_doy , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -392,50 +392,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek - , EXTRACT(DOY FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek - , EXTRACT(DOY FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(DOY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek - , EXTRACT(DOY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql index 027d1adb23..7e38380b20 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_join_node__plan0.sql @@ -33,74 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -127,25 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -154,25 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -201,25 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -228,25 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql index 5e08760139..99d4dba7cb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.account_id__ds_partitioned__day , subq_0.account_id__ds_partitioned__week , subq_0.account_id__ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.account_id__ds_partitioned__extract_month , subq_0.account_id__ds_partitioned__extract_week , subq_0.account_id__ds_partitioned__extract_day - , subq_0.account_id__ds_partitioned__extract_dayofweek - , subq_0.account_id__ds_partitioned__extract_dayofyear + , subq_0.account_id__ds_partitioned__extract_dow + , subq_0.account_id__ds_partitioned__extract_doy , subq_0.account_id__ds__day , subq_0.account_id__ds__week , subq_0.account_id__ds__month @@ -77,8 +77,8 @@ FROM ( , subq_0.account_id__ds__extract_month , subq_0.account_id__ds__extract_week , subq_0.account_id__ds__extract_day - , subq_0.account_id__ds__extract_dayofweek - , subq_0.account_id__ds__extract_dayofyear + , subq_0.account_id__ds__extract_dow + , subq_0.account_id__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month @@ -104,50 +104,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek - , EXTRACT(DOY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -174,8 +174,8 @@ FROM ( , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_3.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_3.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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 @@ -186,8 +186,8 @@ FROM ( , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day - , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek - , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear + , subq_3.account_id__ds_partitioned__extract_dow AS account_id__ds_partitioned__extract_dow + , subq_3.account_id__ds_partitioned__extract_doy AS account_id__ds_partitioned__extract_doy , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month @@ -198,8 +198,8 @@ FROM ( , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow AS customer_id__ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy AS customer_id__ds_partitioned__extract_doy , 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 @@ -216,26 +216,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -283,8 +283,8 @@ FROM ( , subq_4.ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy , subq_4.customer_id__ds_partitioned__day , subq_4.customer_id__ds_partitioned__week , subq_4.customer_id__ds_partitioned__month @@ -295,8 +295,8 @@ FROM ( , subq_4.customer_id__ds_partitioned__extract_month , subq_4.customer_id__ds_partitioned__extract_week , subq_4.customer_id__ds_partitioned__extract_day - , subq_4.customer_id__ds_partitioned__extract_dayofweek - , subq_4.customer_id__ds_partitioned__extract_dayofyear + , subq_4.customer_id__ds_partitioned__extract_dow + , subq_4.customer_id__ds_partitioned__extract_doy , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -312,13 +312,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -326,13 +326,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql index 7eaea2b4de..54b108dd33 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multiple_metrics_no_dimensions__plan0.sql @@ -28,8 +28,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month @@ -40,8 +40,8 @@ FROM ( , subq_1.ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month @@ -52,8 +52,8 @@ FROM ( , subq_1.paid_at__extract_month , subq_1.paid_at__extract_week , subq_1.paid_at__extract_day - , subq_1.paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow + , subq_1.paid_at__extract_doy , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month @@ -64,8 +64,8 @@ FROM ( , subq_1.booking__ds__extract_month , subq_1.booking__ds__extract_week , subq_1.booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow + , subq_1.booking__ds__extract_doy , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month @@ -76,8 +76,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month @@ -88,8 +88,8 @@ FROM ( , subq_1.booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -100,8 +100,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.listing , subq_1.guest , subq_1.host @@ -136,8 +136,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -160,8 +160,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -172,8 +172,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -196,8 +196,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -208,8 +208,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -254,74 +254,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -362,8 +362,8 @@ CROSS JOIN ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month @@ -374,8 +374,8 @@ CROSS JOIN ( , subq_7.created_at__extract_month , subq_7.created_at__extract_week , subq_7.created_at__extract_day - , subq_7.created_at__extract_dayofweek - , subq_7.created_at__extract_dayofyear + , subq_7.created_at__extract_dow + , subq_7.created_at__extract_doy , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month @@ -386,8 +386,8 @@ CROSS JOIN ( , subq_7.listing__ds__extract_month , subq_7.listing__ds__extract_week , subq_7.listing__ds__extract_day - , subq_7.listing__ds__extract_dayofweek - , subq_7.listing__ds__extract_dayofyear + , subq_7.listing__ds__extract_dow + , subq_7.listing__ds__extract_doy , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month @@ -398,8 +398,8 @@ CROSS JOIN ( , subq_7.listing__created_at__extract_month , subq_7.listing__created_at__extract_week , subq_7.listing__created_at__extract_day - , subq_7.listing__created_at__extract_dayofweek - , subq_7.listing__created_at__extract_dayofyear + , subq_7.listing__created_at__extract_dow + , subq_7.listing__created_at__extract_doy , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -410,8 +410,8 @@ CROSS JOIN ( , subq_7.metric_time__extract_month , subq_7.metric_time__extract_week , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dayofweek - , subq_7.metric_time__extract_dayofyear + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.user , subq_7.listing__user @@ -437,8 +437,8 @@ CROSS JOIN ( , subq_6.ds__extract_month , subq_6.ds__extract_week , subq_6.ds__extract_day - , subq_6.ds__extract_dayofweek - , subq_6.ds__extract_dayofyear + , subq_6.ds__extract_dow + , subq_6.ds__extract_doy , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month @@ -449,8 +449,8 @@ CROSS JOIN ( , subq_6.created_at__extract_month , subq_6.created_at__extract_week , subq_6.created_at__extract_day - , subq_6.created_at__extract_dayofweek - , subq_6.created_at__extract_dayofyear + , subq_6.created_at__extract_dow + , subq_6.created_at__extract_doy , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month @@ -461,8 +461,8 @@ CROSS JOIN ( , subq_6.listing__ds__extract_month , subq_6.listing__ds__extract_week , subq_6.listing__ds__extract_day - , subq_6.listing__ds__extract_dayofweek - , subq_6.listing__ds__extract_dayofyear + , subq_6.listing__ds__extract_dow + , subq_6.listing__ds__extract_doy , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month @@ -473,8 +473,8 @@ CROSS JOIN ( , subq_6.listing__created_at__extract_month , subq_6.listing__created_at__extract_week , subq_6.listing__created_at__extract_day - , subq_6.listing__created_at__extract_dayofweek - , subq_6.listing__created_at__extract_dayofyear + , subq_6.listing__created_at__extract_dow + , subq_6.listing__created_at__extract_doy , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -485,8 +485,8 @@ CROSS JOIN ( , subq_6.ds__extract_month AS metric_time__extract_month , subq_6.ds__extract_week AS metric_time__extract_week , subq_6.ds__extract_day AS metric_time__extract_day - , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_6.ds__extract_dow AS metric_time__extract_dow + , subq_6.ds__extract_doy AS metric_time__extract_doy , subq_6.listing , subq_6.user , subq_6.listing__user @@ -510,25 +510,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -537,25 +537,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql index fae92e63dc..a716977aaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_nested_derived_metric__plan0.sql @@ -49,8 +49,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -73,8 +73,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -109,8 +109,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -121,8 +121,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -167,74 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -278,8 +278,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -290,8 +290,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -302,8 +302,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -338,8 +338,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -350,8 +350,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -396,74 +396,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -519,8 +519,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -531,8 +531,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -543,8 +543,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -555,8 +555,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -567,8 +567,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -579,8 +579,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -591,8 +591,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -637,74 +637,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -758,8 +758,8 @@ FROM ( , subq_17.ds__extract_month , subq_17.ds__extract_week , subq_17.ds__extract_day - , subq_17.ds__extract_dayofweek - , subq_17.ds__extract_dayofyear + , subq_17.ds__extract_dow + , subq_17.ds__extract_doy , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month @@ -770,8 +770,8 @@ FROM ( , subq_17.ds_partitioned__extract_month , subq_17.ds_partitioned__extract_week , subq_17.ds_partitioned__extract_day - , subq_17.ds_partitioned__extract_dayofweek - , subq_17.ds_partitioned__extract_dayofyear + , subq_17.ds_partitioned__extract_dow + , subq_17.ds_partitioned__extract_doy , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month @@ -782,8 +782,8 @@ FROM ( , subq_17.paid_at__extract_month , subq_17.paid_at__extract_week , subq_17.paid_at__extract_day - , subq_17.paid_at__extract_dayofweek - , subq_17.paid_at__extract_dayofyear + , subq_17.paid_at__extract_dow + , subq_17.paid_at__extract_doy , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month @@ -794,8 +794,8 @@ FROM ( , subq_17.booking__ds__extract_month , subq_17.booking__ds__extract_week , subq_17.booking__ds__extract_day - , subq_17.booking__ds__extract_dayofweek - , subq_17.booking__ds__extract_dayofyear + , subq_17.booking__ds__extract_dow + , subq_17.booking__ds__extract_doy , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month @@ -806,8 +806,8 @@ FROM ( , subq_17.booking__ds_partitioned__extract_month , subq_17.booking__ds_partitioned__extract_week , subq_17.booking__ds_partitioned__extract_day - , subq_17.booking__ds_partitioned__extract_dayofweek - , subq_17.booking__ds_partitioned__extract_dayofyear + , subq_17.booking__ds_partitioned__extract_dow + , subq_17.booking__ds_partitioned__extract_doy , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month @@ -818,8 +818,8 @@ FROM ( , subq_17.booking__paid_at__extract_month , subq_17.booking__paid_at__extract_week , subq_17.booking__paid_at__extract_day - , subq_17.booking__paid_at__extract_dayofweek - , subq_17.booking__paid_at__extract_dayofyear + , subq_17.booking__paid_at__extract_dow + , subq_17.booking__paid_at__extract_doy , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -830,8 +830,8 @@ FROM ( , subq_17.ds__extract_month AS metric_time__extract_month , subq_17.ds__extract_week AS metric_time__extract_week , subq_17.ds__extract_day AS metric_time__extract_day - , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_17.ds__extract_dow AS metric_time__extract_dow + , subq_17.ds__extract_doy AS metric_time__extract_doy , subq_17.listing , subq_17.guest , subq_17.host @@ -876,74 +876,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql index 3ada9bf35a..d6632b499f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_order_by_node__plan0.sql @@ -45,74 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql index 6eeaaeaeef..44cff4ab94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_partitioned_join__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month @@ -65,8 +65,8 @@ FROM ( , subq_0.verification__ds__extract_month , subq_0.verification__ds__extract_week , subq_0.verification__ds__extract_day - , subq_0.verification__ds__extract_dayofweek - , subq_0.verification__ds__extract_dayofyear + , subq_0.verification__ds__extract_dow + , subq_0.verification__ds__extract_doy , subq_0.verification__ds_partitioned__day , subq_0.verification__ds_partitioned__week , subq_0.verification__ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.verification__ds_partitioned__extract_month , subq_0.verification__ds_partitioned__extract_week , subq_0.verification__ds_partitioned__extract_day - , subq_0.verification__ds_partitioned__extract_dayofweek - , subq_0.verification__ds_partitioned__extract_dayofyear + , subq_0.verification__ds_partitioned__extract_dow + , subq_0.verification__ds_partitioned__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.verification , subq_0.user , subq_0.verification__user @@ -106,50 +106,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -173,74 +173,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek - , EXTRACT(DOY FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek - , EXTRACT(DOY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql index f26bd34521..33fc914795 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -82,26 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql index 0e5972d3ea..d90abbd294 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql index fa1d4a6720..dc98b44d95 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index 3c78b2147d..d723157d2a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 3dcd0390ef..95274f2863 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index e722f24125..e0c877bdf1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql index e2cc098fae..9c6e0a2676 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_single_join_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -125,25 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -152,25 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DOY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql index e337bd9061..b9ae7f84a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql index 82a5abe48e..d1560d9ab0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_source_node__plan0_optimized.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql index 618f5f9d28..b954d8927e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_common_semantic_model__plan0.sql @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -379,74 +379,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql index 70db1edf09..b1bf877e84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 350c29d01e..5373f3b9a9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -174,74 +174,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -344,25 +344,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,25 +371,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -519,49 +519,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_doy + , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_doy + , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -662,25 +662,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -689,25 +689,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index 6cae314057..1bd176c115 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,74 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,25 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,25 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql index 26ccf221dd..cd879426f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql index 3de0908e02..5b6dd99cc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_constrain_time_range_node__plan0.sql @@ -38,74 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql index ac35263413..6920a36691 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric__plan0.sql @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql index abf31492df..4080ab9420 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_grain_to_date__plan0.sql @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql index 20b5cb5156..fcf74a5947 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_ds__plan0.sql @@ -61,25 +61,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql index aee104bfff..0143335613 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window__plan0.sql @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 7ba9208a6a..5cba3a3202 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql index 788131918a..414159089b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_time_constraint__plan0.sql @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql index 09e9a7df29..5b4011175d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric__plan0.sql @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -384,74 +384,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql index 2f56bdd23c..d11a69936d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain__plan0.sql @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index c6aea810c4..b98d6d0f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql index 0596eaabd8..38aeec72e9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window__plan0.sql @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 27218c34d0..0ad6211336 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 539423b5b3..c987150223 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -593,74 +593,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 62ac8e39b4..cddee48ddb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql index 23ad4fab94..94cf44278b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_cumulative_metric__plan0.sql @@ -366,74 +366,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql index 6c3c772ab7..6b4f9e31f9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -252,74 +252,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql index dae3f52e98..40f6785af3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_distinct_values__plan0.sql @@ -165,74 +165,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -335,25 +335,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -362,25 +362,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql index 395033b94a..a43457fcbd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_node__plan0.sql @@ -25,74 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql index 18c852b528..a3ce23fb89 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql index 028e45452a..70919d8caa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -171,74 +171,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -341,25 +341,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -368,25 +368,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql index c2f4c8e617..6e4488a729 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_scd_dimension__plan0.sql @@ -159,74 +159,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -255,25 +255,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -282,25 +282,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 56ed62001f..9f23719b49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql index 7dafb98791..406b83cae3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql index 5bf86bf052..2093e49b0b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_join_to_time_spine_node_without_offset__plan0.sql @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql index 1680cc5146..eb506ddf59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_limit_rows__plan0.sql @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql index 909e22c61e..d5688f0e2d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_local_dimension_using_local_entity__plan0.sql @@ -99,25 +99,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -126,25 +126,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql index 65582ae31f..dbfcb34b94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_aggregation_node__plan0.sql @@ -35,74 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql index f74d279e69..e5349b0d17 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint__plan0.sql @@ -183,74 +183,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -353,25 +353,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -380,25 +380,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -764,25 +764,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -791,25 +791,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -988,74 +988,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql index f536c2ec12..c11754db0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_reused_measure__plan0.sql @@ -168,74 +168,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -400,74 +400,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 61e0a3c0e0..bd41d48bd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -162,74 +162,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 59683b27c8..ecc15101fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -329,25 +329,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -356,25 +356,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql index 3f01da6648..d1740a6a39 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -318,25 +318,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -345,25 +345,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -437,26 +437,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_doy + , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_doy + , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql index 2303464654..8abc633b9a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -392,50 +392,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql index 2ef9e97902..7e38380b20 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_join_node__plan0.sql @@ -33,74 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -127,25 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -154,25 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -201,25 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -228,25 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql index 5a28324203..99d4dba7cb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql @@ -104,50 +104,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_doy + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -216,26 +216,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -312,13 +312,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -326,13 +326,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql index 38e701d35f..54b108dd33 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multiple_metrics_no_dimensions__plan0.sql @@ -254,74 +254,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -510,25 +510,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -537,25 +537,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql index c84ceda6fa..a716977aaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_nested_derived_metric__plan0.sql @@ -167,74 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -396,74 +396,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -637,74 +637,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -876,74 +876,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql index d9c8ed0995..d6632b499f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_order_by_node__plan0.sql @@ -45,74 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql index 73a3eb36fd..44cff4ab94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_partitioned_join__plan0.sql @@ -106,50 +106,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -173,74 +173,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_doy + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql index bf73140286..33fc914795 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0.sql @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -82,26 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql index 37fb636c96..d90abbd294 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node__plan0_optimized.sql @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql index 5801bf4ecd..dc98b44d95 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0.sql @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index b83343fe92..d723157d2a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql index d76c04b1c2..95274f2863 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index 7b9abd7ccb..e0c877bdf1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql index 79dbc6f87e..9c6e0a2676 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_single_join_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -125,25 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -152,25 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql index a046c27cbb..b9ae7f84a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql index fd0050700e..d1560d9ab0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_source_node__plan0_optimized.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql index d2a3c6afd9..b954d8927e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_common_semantic_model__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -379,74 +379,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql index c80b16baf0..b1bf877e84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 2426067bd3..12e006e550 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -56,8 +56,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -68,8 +68,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -80,8 +80,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -116,8 +116,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -128,8 +128,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -174,74 +174,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -271,8 +271,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -283,8 +283,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -295,8 +295,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -307,8 +307,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -319,8 +319,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -344,25 +344,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,25 +371,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -455,8 +455,8 @@ FROM ( , subq_10.ds__extract_month , subq_10.ds__extract_week , subq_10.ds__extract_day - , subq_10.ds__extract_dayofweek - , subq_10.ds__extract_dayofyear + , subq_10.ds__extract_dow + , subq_10.ds__extract_doy , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month @@ -467,8 +467,8 @@ FROM ( , subq_10.ds_partitioned__extract_month , subq_10.ds_partitioned__extract_week , subq_10.ds_partitioned__extract_day - , subq_10.ds_partitioned__extract_dayofweek - , subq_10.ds_partitioned__extract_dayofyear + , subq_10.ds_partitioned__extract_dow + , subq_10.ds_partitioned__extract_doy , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month @@ -479,8 +479,8 @@ FROM ( , subq_10.view__ds__extract_month , subq_10.view__ds__extract_week , subq_10.view__ds__extract_day - , subq_10.view__ds__extract_dayofweek - , subq_10.view__ds__extract_dayofyear + , subq_10.view__ds__extract_dow + , subq_10.view__ds__extract_doy , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month @@ -491,8 +491,8 @@ FROM ( , subq_10.view__ds_partitioned__extract_month , subq_10.view__ds_partitioned__extract_week , subq_10.view__ds_partitioned__extract_day - , subq_10.view__ds_partitioned__extract_dayofweek - , subq_10.view__ds_partitioned__extract_dayofyear + , subq_10.view__ds_partitioned__extract_dow + , subq_10.view__ds_partitioned__extract_doy , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -503,8 +503,8 @@ FROM ( , subq_10.ds__extract_month AS metric_time__extract_month , subq_10.ds__extract_week AS metric_time__extract_week , subq_10.ds__extract_day AS metric_time__extract_day - , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_10.ds__extract_dow AS metric_time__extract_dow + , subq_10.ds__extract_doy AS metric_time__extract_doy , subq_10.listing , subq_10.user , subq_10.view__listing @@ -519,49 +519,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -589,8 +589,8 @@ FROM ( , subq_13.ds__extract_month , subq_13.ds__extract_week , subq_13.ds__extract_day - , subq_13.ds__extract_dayofweek - , subq_13.ds__extract_dayofyear + , subq_13.ds__extract_dow + , subq_13.ds__extract_doy , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month @@ -601,8 +601,8 @@ FROM ( , subq_13.created_at__extract_month , subq_13.created_at__extract_week , subq_13.created_at__extract_day - , subq_13.created_at__extract_dayofweek - , subq_13.created_at__extract_dayofyear + , subq_13.created_at__extract_dow + , subq_13.created_at__extract_doy , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month @@ -613,8 +613,8 @@ FROM ( , subq_13.listing__ds__extract_month , subq_13.listing__ds__extract_week , subq_13.listing__ds__extract_day - , subq_13.listing__ds__extract_dayofweek - , subq_13.listing__ds__extract_dayofyear + , subq_13.listing__ds__extract_dow + , subq_13.listing__ds__extract_doy , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month @@ -625,8 +625,8 @@ FROM ( , subq_13.listing__created_at__extract_month , subq_13.listing__created_at__extract_week , subq_13.listing__created_at__extract_day - , subq_13.listing__created_at__extract_dayofweek - , subq_13.listing__created_at__extract_dayofyear + , subq_13.listing__created_at__extract_dow + , subq_13.listing__created_at__extract_doy , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -637,8 +637,8 @@ FROM ( , subq_13.ds__extract_month AS metric_time__extract_month , subq_13.ds__extract_week AS metric_time__extract_week , subq_13.ds__extract_day AS metric_time__extract_day - , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_13.ds__extract_dow AS metric_time__extract_dow + , subq_13.ds__extract_doy AS metric_time__extract_doy , subq_13.listing , subq_13.user , subq_13.listing__user @@ -662,25 +662,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -689,25 +689,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index b2d5615477..bcb36633c9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,74 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,25 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,25 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql index b6f01861d7..cd879426f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql index d480357663..5b6dd99cc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_constrain_time_range_node__plan0.sql @@ -38,74 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql index ad08f90e35..6920a36691 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql index 8c2ab1a915..4080ab9420 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_grain_to_date__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql index 8d5b07c69a..fcf74a5947 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_ds__plan0.sql @@ -23,8 +23,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -35,8 +35,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -61,25 +61,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql index d98f0f554a..0143335613 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 26ab44afcc..5cba3a3202 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql index a670ac2189..414159089b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_cumulative_metric_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql index 3d88c96009..5b4011175d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -266,8 +266,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -278,8 +278,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -290,8 +290,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -302,8 +302,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -338,8 +338,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -384,74 +384,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql index e2ff275b47..d11a69936d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 13d462ce84..b98d6d0f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql index d22bf333b1..5b316563f4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 7255f068da..846598c061 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index aa40a31b84..2ca02e1c57 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -373,8 +373,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -385,8 +385,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -397,8 +397,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -409,8 +409,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -433,8 +433,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -475,8 +475,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -487,8 +487,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -499,8 +499,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -511,8 +511,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -523,8 +523,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -535,8 +535,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -547,8 +547,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -593,74 +593,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index e829053048..f744592adf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -374,8 +374,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -386,8 +386,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -398,8 +398,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -410,8 +410,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -422,8 +422,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -434,8 +434,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -476,8 +476,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql index 106574c4c7..9a9cd18ee2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_cumulative_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_4.ds__extract_month AS ds__extract_month , subq_4.ds__extract_week AS ds__extract_week , subq_4.ds__extract_day AS ds__extract_day - , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_4.ds__extract_dow AS ds__extract_dow + , subq_4.ds__extract_doy AS ds__extract_doy , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_4.paid_at__extract_month AS paid_at__extract_month , subq_4.paid_at__extract_week AS paid_at__extract_week , subq_4.paid_at__extract_day AS paid_at__extract_day - , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_4.paid_at__extract_dow AS paid_at__extract_dow + , subq_4.paid_at__extract_doy AS paid_at__extract_doy , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_4.booking__ds__extract_month AS booking__ds__extract_month , subq_4.booking__ds__extract_week AS booking__ds__extract_week , subq_4.booking__ds__extract_day AS booking__ds__extract_day - , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_4.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_4.booking__ds__extract_doy AS booking__ds__extract_doy , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_4.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_4.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -135,8 +135,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -147,8 +147,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -159,8 +159,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -171,8 +171,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -183,8 +183,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -195,8 +195,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -206,8 +206,8 @@ FROM ( , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.metric_time__extract_week AS metric_time__extract_week , subq_1.metric_time__extract_day AS metric_time__extract_day - , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -248,8 +248,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -260,8 +260,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -272,8 +272,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -284,8 +284,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -296,8 +296,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -308,8 +308,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -320,8 +320,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -366,74 +366,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql index 16a95d6b9f..d49d04d52c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -134,8 +134,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -146,8 +146,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -158,8 +158,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -170,8 +170,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -206,8 +206,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -252,74 +252,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql index 693e200db3..40f6785af3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_distinct_values__plan0.sql @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -59,8 +59,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -71,8 +71,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -83,8 +83,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -95,8 +95,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -107,8 +107,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,8 +119,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,74 +165,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -262,8 +262,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -274,8 +274,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -298,8 +298,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -310,8 +310,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -335,25 +335,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -362,25 +362,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql index 00efad0383..a43457fcbd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_node__plan0.sql @@ -25,74 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql index 7e0fdff19e..a3ce23fb89 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql index 1a6844636c..70919d8caa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -77,8 +77,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -89,8 +89,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,8 +125,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -171,74 +171,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -268,8 +268,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -280,8 +280,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -292,8 +292,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -316,8 +316,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -341,25 +341,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -368,25 +368,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql index 5712e1d25c..6e4488a729 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_scd_dimension__plan0.sql @@ -55,8 +55,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -67,8 +67,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -79,8 +79,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -103,8 +103,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -115,8 +115,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -127,8 +127,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -159,74 +159,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -255,25 +255,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -282,25 +282,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 141c4fba09..9f23719b49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql index abf246ee40..cb25d5128e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql index 7c85ab1cdb..2093e49b0b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_join_to_time_spine_node_without_offset__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql index e89a957806..eb506ddf59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_limit_rows__plan0.sql @@ -31,8 +31,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -43,8 +43,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -55,8 +55,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -67,8 +67,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -103,8 +103,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql index 436f0e7545..d5688f0e2d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_local_dimension_using_local_entity__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month @@ -38,8 +38,8 @@ FROM ( , subq_0.created_at__extract_month , subq_0.created_at__extract_week , subq_0.created_at__extract_day - , subq_0.created_at__extract_dayofweek - , subq_0.created_at__extract_dayofyear + , subq_0.created_at__extract_dow + , subq_0.created_at__extract_doy , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month @@ -50,8 +50,8 @@ FROM ( , subq_0.listing__ds__extract_month , subq_0.listing__ds__extract_week , subq_0.listing__ds__extract_day - , subq_0.listing__ds__extract_dayofweek - , subq_0.listing__ds__extract_dayofyear + , subq_0.listing__ds__extract_dow + , subq_0.listing__ds__extract_doy , subq_0.listing__created_at__day , subq_0.listing__created_at__week , subq_0.listing__created_at__month @@ -62,8 +62,8 @@ FROM ( , subq_0.listing__created_at__extract_month , subq_0.listing__created_at__extract_week , subq_0.listing__created_at__extract_day - , subq_0.listing__created_at__extract_dayofweek - , subq_0.listing__created_at__extract_dayofyear + , subq_0.listing__created_at__extract_dow + , subq_0.listing__created_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -74,8 +74,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.user , subq_0.listing__user @@ -99,25 +99,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -126,25 +126,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql index b05da97264..dbfcb34b94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_aggregation_node__plan0.sql @@ -35,74 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql index 9223eebd6e..e5349b0d17 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint__plan0.sql @@ -65,8 +65,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -89,8 +89,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -125,8 +125,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -137,8 +137,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -183,74 +183,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -280,8 +280,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -316,8 +316,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -328,8 +328,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -353,25 +353,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -380,25 +380,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -476,8 +476,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -691,8 +691,8 @@ FROM ( , subq_15.ds__extract_month , subq_15.ds__extract_week , subq_15.ds__extract_day - , subq_15.ds__extract_dayofweek - , subq_15.ds__extract_dayofyear + , subq_15.ds__extract_dow + , subq_15.ds__extract_doy , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month @@ -703,8 +703,8 @@ FROM ( , subq_15.created_at__extract_month , subq_15.created_at__extract_week , subq_15.created_at__extract_day - , subq_15.created_at__extract_dayofweek - , subq_15.created_at__extract_dayofyear + , subq_15.created_at__extract_dow + , subq_15.created_at__extract_doy , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month @@ -715,8 +715,8 @@ FROM ( , subq_15.listing__ds__extract_month , subq_15.listing__ds__extract_week , subq_15.listing__ds__extract_day - , subq_15.listing__ds__extract_dayofweek - , subq_15.listing__ds__extract_dayofyear + , subq_15.listing__ds__extract_dow + , subq_15.listing__ds__extract_doy , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month @@ -727,8 +727,8 @@ FROM ( , subq_15.listing__created_at__extract_month , subq_15.listing__created_at__extract_week , subq_15.listing__created_at__extract_day - , subq_15.listing__created_at__extract_dayofweek - , subq_15.listing__created_at__extract_dayofyear + , subq_15.listing__created_at__extract_dow + , subq_15.listing__created_at__extract_doy , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -739,8 +739,8 @@ FROM ( , subq_15.ds__extract_month AS metric_time__extract_month , subq_15.ds__extract_week AS metric_time__extract_week , subq_15.ds__extract_day AS metric_time__extract_day - , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_15.ds__extract_dow AS metric_time__extract_dow + , subq_15.ds__extract_doy AS metric_time__extract_doy , subq_15.listing , subq_15.user , subq_15.listing__user @@ -764,25 +764,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -791,25 +791,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -870,8 +870,8 @@ FROM ( , subq_24.ds__extract_month , subq_24.ds__extract_week , subq_24.ds__extract_day - , subq_24.ds__extract_dayofweek - , subq_24.ds__extract_dayofyear + , subq_24.ds__extract_dow + , subq_24.ds__extract_doy , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month @@ -882,8 +882,8 @@ FROM ( , subq_24.ds_partitioned__extract_month , subq_24.ds_partitioned__extract_week , subq_24.ds_partitioned__extract_day - , subq_24.ds_partitioned__extract_dayofweek - , subq_24.ds_partitioned__extract_dayofyear + , subq_24.ds_partitioned__extract_dow + , subq_24.ds_partitioned__extract_doy , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month @@ -894,8 +894,8 @@ FROM ( , subq_24.paid_at__extract_month , subq_24.paid_at__extract_week , subq_24.paid_at__extract_day - , subq_24.paid_at__extract_dayofweek - , subq_24.paid_at__extract_dayofyear + , subq_24.paid_at__extract_dow + , subq_24.paid_at__extract_doy , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month @@ -906,8 +906,8 @@ FROM ( , subq_24.booking__ds__extract_month , subq_24.booking__ds__extract_week , subq_24.booking__ds__extract_day - , subq_24.booking__ds__extract_dayofweek - , subq_24.booking__ds__extract_dayofyear + , subq_24.booking__ds__extract_dow + , subq_24.booking__ds__extract_doy , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month @@ -918,8 +918,8 @@ FROM ( , subq_24.booking__ds_partitioned__extract_month , subq_24.booking__ds_partitioned__extract_week , subq_24.booking__ds_partitioned__extract_day - , subq_24.booking__ds_partitioned__extract_dayofweek - , subq_24.booking__ds_partitioned__extract_dayofyear + , subq_24.booking__ds_partitioned__extract_dow + , subq_24.booking__ds_partitioned__extract_doy , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month @@ -930,8 +930,8 @@ FROM ( , subq_24.booking__paid_at__extract_month , subq_24.booking__paid_at__extract_week , subq_24.booking__paid_at__extract_day - , subq_24.booking__paid_at__extract_dayofweek - , subq_24.booking__paid_at__extract_dayofyear + , subq_24.booking__paid_at__extract_dow + , subq_24.booking__paid_at__extract_doy , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -942,8 +942,8 @@ FROM ( , subq_24.ds__extract_month AS metric_time__extract_month , subq_24.ds__extract_week AS metric_time__extract_week , subq_24.ds__extract_day AS metric_time__extract_day - , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_24.ds__extract_dow AS metric_time__extract_dow + , subq_24.ds__extract_doy AS metric_time__extract_doy , subq_24.listing , subq_24.guest , subq_24.host @@ -988,74 +988,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql index 0512790e47..61d8df3842 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_reused_measure__plan0.sql @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -74,8 +74,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -86,8 +86,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,8 +122,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -168,74 +168,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -282,8 +282,8 @@ FROM ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month @@ -294,8 +294,8 @@ FROM ( , subq_7.ds_partitioned__extract_month , subq_7.ds_partitioned__extract_week , subq_7.ds_partitioned__extract_day - , subq_7.ds_partitioned__extract_dayofweek - , subq_7.ds_partitioned__extract_dayofyear + , subq_7.ds_partitioned__extract_dow + , subq_7.ds_partitioned__extract_doy , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month @@ -306,8 +306,8 @@ FROM ( , subq_7.paid_at__extract_month , subq_7.paid_at__extract_week , subq_7.paid_at__extract_day - , subq_7.paid_at__extract_dayofweek - , subq_7.paid_at__extract_dayofyear + , subq_7.paid_at__extract_dow + , subq_7.paid_at__extract_doy , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month @@ -318,8 +318,8 @@ FROM ( , subq_7.booking__ds__extract_month , subq_7.booking__ds__extract_week , subq_7.booking__ds__extract_day - , subq_7.booking__ds__extract_dayofweek - , subq_7.booking__ds__extract_dayofyear + , subq_7.booking__ds__extract_dow + , subq_7.booking__ds__extract_doy , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month @@ -330,8 +330,8 @@ FROM ( , subq_7.booking__ds_partitioned__extract_month , subq_7.booking__ds_partitioned__extract_week , subq_7.booking__ds_partitioned__extract_day - , subq_7.booking__ds_partitioned__extract_dayofweek - , subq_7.booking__ds_partitioned__extract_dayofyear + , subq_7.booking__ds_partitioned__extract_dow + , subq_7.booking__ds_partitioned__extract_doy , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month @@ -342,8 +342,8 @@ FROM ( , subq_7.booking__paid_at__extract_month , subq_7.booking__paid_at__extract_week , subq_7.booking__paid_at__extract_day - , subq_7.booking__paid_at__extract_dayofweek - , subq_7.booking__paid_at__extract_dayofyear + , subq_7.booking__paid_at__extract_dow + , subq_7.booking__paid_at__extract_doy , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -354,8 +354,8 @@ FROM ( , subq_7.ds__extract_month AS metric_time__extract_month , subq_7.ds__extract_week AS metric_time__extract_week , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -400,74 +400,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 2d8a10e755..bd41d48bd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -44,8 +44,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -56,8 +56,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -68,8 +68,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,8 +116,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -162,74 +162,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index f000943d3d..edfbb1483f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -256,8 +256,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month @@ -268,8 +268,8 @@ FROM ( , subq_5.created_at__extract_month , subq_5.created_at__extract_week , subq_5.created_at__extract_day - , subq_5.created_at__extract_dayofweek - , subq_5.created_at__extract_dayofyear + , subq_5.created_at__extract_dow + , subq_5.created_at__extract_doy , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month @@ -280,8 +280,8 @@ FROM ( , subq_5.listing__ds__extract_month , subq_5.listing__ds__extract_week , subq_5.listing__ds__extract_day - , subq_5.listing__ds__extract_dayofweek - , subq_5.listing__ds__extract_dayofyear + , subq_5.listing__ds__extract_dow + , subq_5.listing__ds__extract_doy , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_5.listing__created_at__extract_month , subq_5.listing__created_at__extract_week , subq_5.listing__created_at__extract_day - , subq_5.listing__created_at__extract_dayofweek - , subq_5.listing__created_at__extract_dayofyear + , subq_5.listing__created_at__extract_dow + , subq_5.listing__created_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -304,8 +304,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.user , subq_5.listing__user @@ -329,25 +329,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -356,25 +356,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql index db50a9f2c8..d1740a6a39 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -250,8 +250,8 @@ FROM ( , subq_3.window_start__extract_month AS window_start__extract_month , subq_3.window_start__extract_week AS window_start__extract_week , subq_3.window_start__extract_day AS window_start__extract_day - , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek - , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear + , subq_3.window_start__extract_dow AS window_start__extract_dow + , subq_3.window_start__extract_doy AS window_start__extract_doy , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month @@ -262,8 +262,8 @@ FROM ( , subq_3.window_end__extract_month AS window_end__extract_month , subq_3.window_end__extract_week AS window_end__extract_week , subq_3.window_end__extract_day AS window_end__extract_day - , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek - , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear + , subq_3.window_end__extract_dow AS window_end__extract_dow + , subq_3.window_end__extract_doy AS window_end__extract_doy , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month @@ -274,8 +274,8 @@ FROM ( , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day - , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek - , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_3.listing__window_start__extract_dow AS listing__window_start__extract_dow + , subq_3.listing__window_start__extract_doy AS listing__window_start__extract_doy , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day - , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek - , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_3.listing__window_end__extract_dow AS listing__window_end__extract_dow + , subq_3.listing__window_end__extract_doy AS listing__window_end__extract_doy , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month @@ -298,8 +298,8 @@ FROM ( , subq_5.ds__extract_month AS user__ds__extract_month , subq_5.ds__extract_week AS user__ds__extract_week , subq_5.ds__extract_day AS user__ds__extract_day - , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek - , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear + , subq_5.ds__extract_dow AS user__ds__extract_dow + , subq_5.ds__extract_doy AS user__ds__extract_doy , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -318,25 +318,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -345,25 +345,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -412,8 +412,8 @@ FROM ( , subq_4.ds__extract_month , subq_4.ds__extract_week , subq_4.ds__extract_day - , subq_4.ds__extract_dayofweek - , subq_4.ds__extract_dayofyear + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month @@ -424,8 +424,8 @@ FROM ( , subq_4.user__ds__extract_month , subq_4.user__ds__extract_week , subq_4.user__ds__extract_day - , subq_4.user__ds__extract_dayofweek - , subq_4.user__ds__extract_dayofyear + , subq_4.user__ds__extract_dow + , subq_4.user__ds__extract_doy , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -437,26 +437,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql index adaf16cf58..8abc633b9a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -253,8 +253,8 @@ FROM ( , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day - , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek - , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear + , subq_5.window_start__extract_dow AS lux_listing__window_start__extract_dow + , subq_5.window_start__extract_doy AS lux_listing__window_start__extract_doy , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month @@ -265,8 +265,8 @@ FROM ( , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day - , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek - , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear + , subq_5.window_end__extract_dow AS lux_listing__window_end__extract_dow + , subq_5.window_end__extract_doy AS lux_listing__window_end__extract_doy , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -343,8 +343,8 @@ FROM ( , subq_4.window_start__extract_month , subq_4.window_start__extract_week , subq_4.window_start__extract_day - , subq_4.window_start__extract_dayofweek - , subq_4.window_start__extract_dayofyear + , subq_4.window_start__extract_dow + , subq_4.window_start__extract_doy , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month @@ -355,8 +355,8 @@ FROM ( , subq_4.window_end__extract_month , subq_4.window_end__extract_week , subq_4.window_end__extract_day - , subq_4.window_end__extract_dayofweek - , subq_4.window_end__extract_dayofyear + , subq_4.window_end__extract_dow + , subq_4.window_end__extract_doy , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month @@ -367,8 +367,8 @@ FROM ( , subq_4.lux_listing__window_start__extract_month , subq_4.lux_listing__window_start__extract_week , subq_4.lux_listing__window_start__extract_day - , subq_4.lux_listing__window_start__extract_dayofweek - , subq_4.lux_listing__window_start__extract_dayofyear + , subq_4.lux_listing__window_start__extract_dow + , subq_4.lux_listing__window_start__extract_doy , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month @@ -379,8 +379,8 @@ FROM ( , subq_4.lux_listing__window_end__extract_month , subq_4.lux_listing__window_end__extract_week , subq_4.lux_listing__window_end__extract_day - , subq_4.lux_listing__window_end__extract_dayofweek - , subq_4.lux_listing__window_end__extract_dayofyear + , subq_4.lux_listing__window_end__extract_dow + , subq_4.lux_listing__window_end__extract_doy , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -392,50 +392,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql index cb9670f074..7e38380b20 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_join_node__plan0.sql @@ -33,74 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -127,25 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -154,25 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -201,25 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -228,25 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql index 7638105966..99d4dba7cb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.account_id__ds_partitioned__day , subq_0.account_id__ds_partitioned__week , subq_0.account_id__ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.account_id__ds_partitioned__extract_month , subq_0.account_id__ds_partitioned__extract_week , subq_0.account_id__ds_partitioned__extract_day - , subq_0.account_id__ds_partitioned__extract_dayofweek - , subq_0.account_id__ds_partitioned__extract_dayofyear + , subq_0.account_id__ds_partitioned__extract_dow + , subq_0.account_id__ds_partitioned__extract_doy , subq_0.account_id__ds__day , subq_0.account_id__ds__week , subq_0.account_id__ds__month @@ -77,8 +77,8 @@ FROM ( , subq_0.account_id__ds__extract_month , subq_0.account_id__ds__extract_week , subq_0.account_id__ds__extract_day - , subq_0.account_id__ds__extract_dayofweek - , subq_0.account_id__ds__extract_dayofyear + , subq_0.account_id__ds__extract_dow + , subq_0.account_id__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month @@ -104,50 +104,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -174,8 +174,8 @@ FROM ( , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_3.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_3.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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 @@ -186,8 +186,8 @@ FROM ( , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day - , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek - , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear + , subq_3.account_id__ds_partitioned__extract_dow AS account_id__ds_partitioned__extract_dow + , subq_3.account_id__ds_partitioned__extract_doy AS account_id__ds_partitioned__extract_doy , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month @@ -198,8 +198,8 @@ FROM ( , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow AS customer_id__ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy AS customer_id__ds_partitioned__extract_doy , 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 @@ -216,26 +216,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -283,8 +283,8 @@ FROM ( , subq_4.ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy , subq_4.customer_id__ds_partitioned__day , subq_4.customer_id__ds_partitioned__week , subq_4.customer_id__ds_partitioned__month @@ -295,8 +295,8 @@ FROM ( , subq_4.customer_id__ds_partitioned__extract_month , subq_4.customer_id__ds_partitioned__extract_week , subq_4.customer_id__ds_partitioned__extract_day - , subq_4.customer_id__ds_partitioned__extract_dayofweek - , subq_4.customer_id__ds_partitioned__extract_dayofyear + , subq_4.customer_id__ds_partitioned__extract_dow + , subq_4.customer_id__ds_partitioned__extract_doy , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -312,13 +312,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -326,13 +326,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql index 3d8fba9b22..54b108dd33 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multiple_metrics_no_dimensions__plan0.sql @@ -28,8 +28,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month @@ -40,8 +40,8 @@ FROM ( , subq_1.ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month @@ -52,8 +52,8 @@ FROM ( , subq_1.paid_at__extract_month , subq_1.paid_at__extract_week , subq_1.paid_at__extract_day - , subq_1.paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow + , subq_1.paid_at__extract_doy , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month @@ -64,8 +64,8 @@ FROM ( , subq_1.booking__ds__extract_month , subq_1.booking__ds__extract_week , subq_1.booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow + , subq_1.booking__ds__extract_doy , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month @@ -76,8 +76,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month @@ -88,8 +88,8 @@ FROM ( , subq_1.booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -100,8 +100,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.listing , subq_1.guest , subq_1.host @@ -136,8 +136,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -160,8 +160,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -172,8 +172,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -196,8 +196,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -208,8 +208,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -254,74 +254,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -362,8 +362,8 @@ CROSS JOIN ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month @@ -374,8 +374,8 @@ CROSS JOIN ( , subq_7.created_at__extract_month , subq_7.created_at__extract_week , subq_7.created_at__extract_day - , subq_7.created_at__extract_dayofweek - , subq_7.created_at__extract_dayofyear + , subq_7.created_at__extract_dow + , subq_7.created_at__extract_doy , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month @@ -386,8 +386,8 @@ CROSS JOIN ( , subq_7.listing__ds__extract_month , subq_7.listing__ds__extract_week , subq_7.listing__ds__extract_day - , subq_7.listing__ds__extract_dayofweek - , subq_7.listing__ds__extract_dayofyear + , subq_7.listing__ds__extract_dow + , subq_7.listing__ds__extract_doy , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month @@ -398,8 +398,8 @@ CROSS JOIN ( , subq_7.listing__created_at__extract_month , subq_7.listing__created_at__extract_week , subq_7.listing__created_at__extract_day - , subq_7.listing__created_at__extract_dayofweek - , subq_7.listing__created_at__extract_dayofyear + , subq_7.listing__created_at__extract_dow + , subq_7.listing__created_at__extract_doy , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -410,8 +410,8 @@ CROSS JOIN ( , subq_7.metric_time__extract_month , subq_7.metric_time__extract_week , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dayofweek - , subq_7.metric_time__extract_dayofyear + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.user , subq_7.listing__user @@ -437,8 +437,8 @@ CROSS JOIN ( , subq_6.ds__extract_month , subq_6.ds__extract_week , subq_6.ds__extract_day - , subq_6.ds__extract_dayofweek - , subq_6.ds__extract_dayofyear + , subq_6.ds__extract_dow + , subq_6.ds__extract_doy , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month @@ -449,8 +449,8 @@ CROSS JOIN ( , subq_6.created_at__extract_month , subq_6.created_at__extract_week , subq_6.created_at__extract_day - , subq_6.created_at__extract_dayofweek - , subq_6.created_at__extract_dayofyear + , subq_6.created_at__extract_dow + , subq_6.created_at__extract_doy , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month @@ -461,8 +461,8 @@ CROSS JOIN ( , subq_6.listing__ds__extract_month , subq_6.listing__ds__extract_week , subq_6.listing__ds__extract_day - , subq_6.listing__ds__extract_dayofweek - , subq_6.listing__ds__extract_dayofyear + , subq_6.listing__ds__extract_dow + , subq_6.listing__ds__extract_doy , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month @@ -473,8 +473,8 @@ CROSS JOIN ( , subq_6.listing__created_at__extract_month , subq_6.listing__created_at__extract_week , subq_6.listing__created_at__extract_day - , subq_6.listing__created_at__extract_dayofweek - , subq_6.listing__created_at__extract_dayofyear + , subq_6.listing__created_at__extract_dow + , subq_6.listing__created_at__extract_doy , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -485,8 +485,8 @@ CROSS JOIN ( , subq_6.ds__extract_month AS metric_time__extract_month , subq_6.ds__extract_week AS metric_time__extract_week , subq_6.ds__extract_day AS metric_time__extract_day - , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_6.ds__extract_dow AS metric_time__extract_dow + , subq_6.ds__extract_doy AS metric_time__extract_doy , subq_6.listing , subq_6.user , subq_6.listing__user @@ -510,25 +510,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -537,25 +537,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql index 138d3b47ca..a716977aaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_nested_derived_metric__plan0.sql @@ -49,8 +49,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -73,8 +73,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -109,8 +109,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -121,8 +121,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -167,74 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -278,8 +278,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -290,8 +290,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -302,8 +302,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -338,8 +338,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -350,8 +350,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -396,74 +396,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -519,8 +519,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -531,8 +531,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -543,8 +543,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -555,8 +555,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -567,8 +567,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -579,8 +579,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -591,8 +591,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -637,74 +637,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -758,8 +758,8 @@ FROM ( , subq_17.ds__extract_month , subq_17.ds__extract_week , subq_17.ds__extract_day - , subq_17.ds__extract_dayofweek - , subq_17.ds__extract_dayofyear + , subq_17.ds__extract_dow + , subq_17.ds__extract_doy , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month @@ -770,8 +770,8 @@ FROM ( , subq_17.ds_partitioned__extract_month , subq_17.ds_partitioned__extract_week , subq_17.ds_partitioned__extract_day - , subq_17.ds_partitioned__extract_dayofweek - , subq_17.ds_partitioned__extract_dayofyear + , subq_17.ds_partitioned__extract_dow + , subq_17.ds_partitioned__extract_doy , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month @@ -782,8 +782,8 @@ FROM ( , subq_17.paid_at__extract_month , subq_17.paid_at__extract_week , subq_17.paid_at__extract_day - , subq_17.paid_at__extract_dayofweek - , subq_17.paid_at__extract_dayofyear + , subq_17.paid_at__extract_dow + , subq_17.paid_at__extract_doy , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month @@ -794,8 +794,8 @@ FROM ( , subq_17.booking__ds__extract_month , subq_17.booking__ds__extract_week , subq_17.booking__ds__extract_day - , subq_17.booking__ds__extract_dayofweek - , subq_17.booking__ds__extract_dayofyear + , subq_17.booking__ds__extract_dow + , subq_17.booking__ds__extract_doy , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month @@ -806,8 +806,8 @@ FROM ( , subq_17.booking__ds_partitioned__extract_month , subq_17.booking__ds_partitioned__extract_week , subq_17.booking__ds_partitioned__extract_day - , subq_17.booking__ds_partitioned__extract_dayofweek - , subq_17.booking__ds_partitioned__extract_dayofyear + , subq_17.booking__ds_partitioned__extract_dow + , subq_17.booking__ds_partitioned__extract_doy , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month @@ -818,8 +818,8 @@ FROM ( , subq_17.booking__paid_at__extract_month , subq_17.booking__paid_at__extract_week , subq_17.booking__paid_at__extract_day - , subq_17.booking__paid_at__extract_dayofweek - , subq_17.booking__paid_at__extract_dayofyear + , subq_17.booking__paid_at__extract_dow + , subq_17.booking__paid_at__extract_doy , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -830,8 +830,8 @@ FROM ( , subq_17.ds__extract_month AS metric_time__extract_month , subq_17.ds__extract_week AS metric_time__extract_week , subq_17.ds__extract_day AS metric_time__extract_day - , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_17.ds__extract_dow AS metric_time__extract_dow + , subq_17.ds__extract_doy AS metric_time__extract_doy , subq_17.listing , subq_17.guest , subq_17.host @@ -876,74 +876,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql index 63116a5458..d6632b499f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_order_by_node__plan0.sql @@ -45,74 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql index e43e265eff..44cff4ab94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_partitioned_join__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month @@ -65,8 +65,8 @@ FROM ( , subq_0.verification__ds__extract_month , subq_0.verification__ds__extract_week , subq_0.verification__ds__extract_day - , subq_0.verification__ds__extract_dayofweek - , subq_0.verification__ds__extract_dayofyear + , subq_0.verification__ds__extract_dow + , subq_0.verification__ds__extract_doy , subq_0.verification__ds_partitioned__day , subq_0.verification__ds_partitioned__week , subq_0.verification__ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.verification__ds_partitioned__extract_month , subq_0.verification__ds_partitioned__extract_week , subq_0.verification__ds_partitioned__extract_day - , subq_0.verification__ds_partitioned__extract_dayofweek - , subq_0.verification__ds_partitioned__extract_dayofyear + , subq_0.verification__ds_partitioned__extract_dow + , subq_0.verification__ds_partitioned__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.verification , subq_0.user , subq_0.verification__user @@ -106,50 +106,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -173,74 +173,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql index d88d2d32f3..33fc914795 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -82,26 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql index 094486f462..d90abbd294 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql index a8a26c9899..dc98b44d95 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index c400372dd4..d723157d2a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 30ab4c1851..95274f2863 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ef337f422c..e0c877bdf1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql index 16b897731d..9c6e0a2676 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_single_join_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -125,25 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -152,25 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql index 7dd5c3b39d..b9ae7f84a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql index e240956212..d1560d9ab0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_source_node__plan0_optimized.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql index d2a3c6afd9..b954d8927e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_common_semantic_model__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -379,74 +379,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql index c80b16baf0..b1bf877e84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index 2426067bd3..12e006e550 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -56,8 +56,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -68,8 +68,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -80,8 +80,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -116,8 +116,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -128,8 +128,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -174,74 +174,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -271,8 +271,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -283,8 +283,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -295,8 +295,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -307,8 +307,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -319,8 +319,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -344,25 +344,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,25 +371,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -455,8 +455,8 @@ FROM ( , subq_10.ds__extract_month , subq_10.ds__extract_week , subq_10.ds__extract_day - , subq_10.ds__extract_dayofweek - , subq_10.ds__extract_dayofyear + , subq_10.ds__extract_dow + , subq_10.ds__extract_doy , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month @@ -467,8 +467,8 @@ FROM ( , subq_10.ds_partitioned__extract_month , subq_10.ds_partitioned__extract_week , subq_10.ds_partitioned__extract_day - , subq_10.ds_partitioned__extract_dayofweek - , subq_10.ds_partitioned__extract_dayofyear + , subq_10.ds_partitioned__extract_dow + , subq_10.ds_partitioned__extract_doy , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month @@ -479,8 +479,8 @@ FROM ( , subq_10.view__ds__extract_month , subq_10.view__ds__extract_week , subq_10.view__ds__extract_day - , subq_10.view__ds__extract_dayofweek - , subq_10.view__ds__extract_dayofyear + , subq_10.view__ds__extract_dow + , subq_10.view__ds__extract_doy , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month @@ -491,8 +491,8 @@ FROM ( , subq_10.view__ds_partitioned__extract_month , subq_10.view__ds_partitioned__extract_week , subq_10.view__ds_partitioned__extract_day - , subq_10.view__ds_partitioned__extract_dayofweek - , subq_10.view__ds_partitioned__extract_dayofyear + , subq_10.view__ds_partitioned__extract_dow + , subq_10.view__ds_partitioned__extract_doy , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -503,8 +503,8 @@ FROM ( , subq_10.ds__extract_month AS metric_time__extract_month , subq_10.ds__extract_week AS metric_time__extract_week , subq_10.ds__extract_day AS metric_time__extract_day - , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_10.ds__extract_dow AS metric_time__extract_dow + , subq_10.ds__extract_doy AS metric_time__extract_doy , subq_10.listing , subq_10.user , subq_10.view__listing @@ -519,49 +519,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -589,8 +589,8 @@ FROM ( , subq_13.ds__extract_month , subq_13.ds__extract_week , subq_13.ds__extract_day - , subq_13.ds__extract_dayofweek - , subq_13.ds__extract_dayofyear + , subq_13.ds__extract_dow + , subq_13.ds__extract_doy , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month @@ -601,8 +601,8 @@ FROM ( , subq_13.created_at__extract_month , subq_13.created_at__extract_week , subq_13.created_at__extract_day - , subq_13.created_at__extract_dayofweek - , subq_13.created_at__extract_dayofyear + , subq_13.created_at__extract_dow + , subq_13.created_at__extract_doy , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month @@ -613,8 +613,8 @@ FROM ( , subq_13.listing__ds__extract_month , subq_13.listing__ds__extract_week , subq_13.listing__ds__extract_day - , subq_13.listing__ds__extract_dayofweek - , subq_13.listing__ds__extract_dayofyear + , subq_13.listing__ds__extract_dow + , subq_13.listing__ds__extract_doy , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month @@ -625,8 +625,8 @@ FROM ( , subq_13.listing__created_at__extract_month , subq_13.listing__created_at__extract_week , subq_13.listing__created_at__extract_day - , subq_13.listing__created_at__extract_dayofweek - , subq_13.listing__created_at__extract_dayofyear + , subq_13.listing__created_at__extract_dow + , subq_13.listing__created_at__extract_doy , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -637,8 +637,8 @@ FROM ( , subq_13.ds__extract_month AS metric_time__extract_month , subq_13.ds__extract_week AS metric_time__extract_week , subq_13.ds__extract_day AS metric_time__extract_day - , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_13.ds__extract_dow AS metric_time__extract_dow + , subq_13.ds__extract_doy AS metric_time__extract_doy , subq_13.listing , subq_13.user , subq_13.listing__user @@ -662,25 +662,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -689,25 +689,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index b2d5615477..bcb36633c9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,74 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,25 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,25 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql index b6f01861d7..cd879426f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql index d480357663..5b6dd99cc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_constrain_time_range_node__plan0.sql @@ -38,74 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql index ad08f90e35..6920a36691 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql index 8c2ab1a915..4080ab9420 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_grain_to_date__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql index 8d5b07c69a..fcf74a5947 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_ds__plan0.sql @@ -23,8 +23,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -35,8 +35,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -61,25 +61,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql index d98f0f554a..0143335613 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 26ab44afcc..5cba3a3202 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql index a670ac2189..414159089b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_cumulative_metric_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql index 3d88c96009..5b4011175d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -266,8 +266,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -278,8 +278,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -290,8 +290,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -302,8 +302,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -338,8 +338,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -384,74 +384,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql index e2ff275b47..d11a69936d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 13d462ce84..b98d6d0f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql index e3607ad97a..9139bc862d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 71e89d4432..0022a4f526 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 9967c13e88..10bb6c0450 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -373,8 +373,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -385,8 +385,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -397,8 +397,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -409,8 +409,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -433,8 +433,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -475,8 +475,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -487,8 +487,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -499,8 +499,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -511,8 +511,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -523,8 +523,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -535,8 +535,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -547,8 +547,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -593,74 +593,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index b76e01d113..1aaa96b40a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -374,8 +374,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -386,8 +386,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -398,8 +398,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -410,8 +410,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -422,8 +422,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -434,8 +434,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -476,8 +476,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql index 615aae3ac7..3107752f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_cumulative_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_4.ds__extract_month AS ds__extract_month , subq_4.ds__extract_week AS ds__extract_week , subq_4.ds__extract_day AS ds__extract_day - , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_4.ds__extract_dow AS ds__extract_dow + , subq_4.ds__extract_doy AS ds__extract_doy , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_4.paid_at__extract_month AS paid_at__extract_month , subq_4.paid_at__extract_week AS paid_at__extract_week , subq_4.paid_at__extract_day AS paid_at__extract_day - , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_4.paid_at__extract_dow AS paid_at__extract_dow + , subq_4.paid_at__extract_doy AS paid_at__extract_doy , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_4.booking__ds__extract_month AS booking__ds__extract_month , subq_4.booking__ds__extract_week AS booking__ds__extract_week , subq_4.booking__ds__extract_day AS booking__ds__extract_day - , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_4.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_4.booking__ds__extract_doy AS booking__ds__extract_doy , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_4.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_4.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -135,8 +135,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -147,8 +147,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -159,8 +159,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -171,8 +171,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -183,8 +183,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -195,8 +195,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -206,8 +206,8 @@ FROM ( , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.metric_time__extract_week AS metric_time__extract_week , subq_1.metric_time__extract_day AS metric_time__extract_day - , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -248,8 +248,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -260,8 +260,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -272,8 +272,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -284,8 +284,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -296,8 +296,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -308,8 +308,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -320,8 +320,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -366,74 +366,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql index 6f115474ac..666e2d3376 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -134,8 +134,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -146,8 +146,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -158,8 +158,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -170,8 +170,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -206,8 +206,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -252,74 +252,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql index 693e200db3..40f6785af3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_distinct_values__plan0.sql @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -59,8 +59,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -71,8 +71,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -83,8 +83,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -95,8 +95,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -107,8 +107,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,8 +119,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,74 +165,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -262,8 +262,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -274,8 +274,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -298,8 +298,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -310,8 +310,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -335,25 +335,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -362,25 +362,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql index 00efad0383..a43457fcbd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_node__plan0.sql @@ -25,74 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql index 7e0fdff19e..a3ce23fb89 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql index 1a6844636c..70919d8caa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -77,8 +77,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -89,8 +89,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,8 +125,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -171,74 +171,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -268,8 +268,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -280,8 +280,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -292,8 +292,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -316,8 +316,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -341,25 +341,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -368,25 +368,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql index 5712e1d25c..6e4488a729 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_scd_dimension__plan0.sql @@ -55,8 +55,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -67,8 +67,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -79,8 +79,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -103,8 +103,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -115,8 +115,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -127,8 +127,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -159,74 +159,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -255,25 +255,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -282,25 +282,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 141c4fba09..9f23719b49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql index a2adc126d3..1c6b0467ff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql index 7c85ab1cdb..2093e49b0b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_join_to_time_spine_node_without_offset__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql index e89a957806..eb506ddf59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_limit_rows__plan0.sql @@ -31,8 +31,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -43,8 +43,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -55,8 +55,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -67,8 +67,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -103,8 +103,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql index 436f0e7545..d5688f0e2d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_local_dimension_using_local_entity__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month @@ -38,8 +38,8 @@ FROM ( , subq_0.created_at__extract_month , subq_0.created_at__extract_week , subq_0.created_at__extract_day - , subq_0.created_at__extract_dayofweek - , subq_0.created_at__extract_dayofyear + , subq_0.created_at__extract_dow + , subq_0.created_at__extract_doy , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month @@ -50,8 +50,8 @@ FROM ( , subq_0.listing__ds__extract_month , subq_0.listing__ds__extract_week , subq_0.listing__ds__extract_day - , subq_0.listing__ds__extract_dayofweek - , subq_0.listing__ds__extract_dayofyear + , subq_0.listing__ds__extract_dow + , subq_0.listing__ds__extract_doy , subq_0.listing__created_at__day , subq_0.listing__created_at__week , subq_0.listing__created_at__month @@ -62,8 +62,8 @@ FROM ( , subq_0.listing__created_at__extract_month , subq_0.listing__created_at__extract_week , subq_0.listing__created_at__extract_day - , subq_0.listing__created_at__extract_dayofweek - , subq_0.listing__created_at__extract_dayofyear + , subq_0.listing__created_at__extract_dow + , subq_0.listing__created_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -74,8 +74,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.user , subq_0.listing__user @@ -99,25 +99,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -126,25 +126,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql index b05da97264..dbfcb34b94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_aggregation_node__plan0.sql @@ -35,74 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql index 9223eebd6e..e5349b0d17 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint__plan0.sql @@ -65,8 +65,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -89,8 +89,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -125,8 +125,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -137,8 +137,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -183,74 +183,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -280,8 +280,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -316,8 +316,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -328,8 +328,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -353,25 +353,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -380,25 +380,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -476,8 +476,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -691,8 +691,8 @@ FROM ( , subq_15.ds__extract_month , subq_15.ds__extract_week , subq_15.ds__extract_day - , subq_15.ds__extract_dayofweek - , subq_15.ds__extract_dayofyear + , subq_15.ds__extract_dow + , subq_15.ds__extract_doy , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month @@ -703,8 +703,8 @@ FROM ( , subq_15.created_at__extract_month , subq_15.created_at__extract_week , subq_15.created_at__extract_day - , subq_15.created_at__extract_dayofweek - , subq_15.created_at__extract_dayofyear + , subq_15.created_at__extract_dow + , subq_15.created_at__extract_doy , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month @@ -715,8 +715,8 @@ FROM ( , subq_15.listing__ds__extract_month , subq_15.listing__ds__extract_week , subq_15.listing__ds__extract_day - , subq_15.listing__ds__extract_dayofweek - , subq_15.listing__ds__extract_dayofyear + , subq_15.listing__ds__extract_dow + , subq_15.listing__ds__extract_doy , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month @@ -727,8 +727,8 @@ FROM ( , subq_15.listing__created_at__extract_month , subq_15.listing__created_at__extract_week , subq_15.listing__created_at__extract_day - , subq_15.listing__created_at__extract_dayofweek - , subq_15.listing__created_at__extract_dayofyear + , subq_15.listing__created_at__extract_dow + , subq_15.listing__created_at__extract_doy , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -739,8 +739,8 @@ FROM ( , subq_15.ds__extract_month AS metric_time__extract_month , subq_15.ds__extract_week AS metric_time__extract_week , subq_15.ds__extract_day AS metric_time__extract_day - , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_15.ds__extract_dow AS metric_time__extract_dow + , subq_15.ds__extract_doy AS metric_time__extract_doy , subq_15.listing , subq_15.user , subq_15.listing__user @@ -764,25 +764,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -791,25 +791,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -870,8 +870,8 @@ FROM ( , subq_24.ds__extract_month , subq_24.ds__extract_week , subq_24.ds__extract_day - , subq_24.ds__extract_dayofweek - , subq_24.ds__extract_dayofyear + , subq_24.ds__extract_dow + , subq_24.ds__extract_doy , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month @@ -882,8 +882,8 @@ FROM ( , subq_24.ds_partitioned__extract_month , subq_24.ds_partitioned__extract_week , subq_24.ds_partitioned__extract_day - , subq_24.ds_partitioned__extract_dayofweek - , subq_24.ds_partitioned__extract_dayofyear + , subq_24.ds_partitioned__extract_dow + , subq_24.ds_partitioned__extract_doy , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month @@ -894,8 +894,8 @@ FROM ( , subq_24.paid_at__extract_month , subq_24.paid_at__extract_week , subq_24.paid_at__extract_day - , subq_24.paid_at__extract_dayofweek - , subq_24.paid_at__extract_dayofyear + , subq_24.paid_at__extract_dow + , subq_24.paid_at__extract_doy , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month @@ -906,8 +906,8 @@ FROM ( , subq_24.booking__ds__extract_month , subq_24.booking__ds__extract_week , subq_24.booking__ds__extract_day - , subq_24.booking__ds__extract_dayofweek - , subq_24.booking__ds__extract_dayofyear + , subq_24.booking__ds__extract_dow + , subq_24.booking__ds__extract_doy , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month @@ -918,8 +918,8 @@ FROM ( , subq_24.booking__ds_partitioned__extract_month , subq_24.booking__ds_partitioned__extract_week , subq_24.booking__ds_partitioned__extract_day - , subq_24.booking__ds_partitioned__extract_dayofweek - , subq_24.booking__ds_partitioned__extract_dayofyear + , subq_24.booking__ds_partitioned__extract_dow + , subq_24.booking__ds_partitioned__extract_doy , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month @@ -930,8 +930,8 @@ FROM ( , subq_24.booking__paid_at__extract_month , subq_24.booking__paid_at__extract_week , subq_24.booking__paid_at__extract_day - , subq_24.booking__paid_at__extract_dayofweek - , subq_24.booking__paid_at__extract_dayofyear + , subq_24.booking__paid_at__extract_dow + , subq_24.booking__paid_at__extract_doy , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -942,8 +942,8 @@ FROM ( , subq_24.ds__extract_month AS metric_time__extract_month , subq_24.ds__extract_week AS metric_time__extract_week , subq_24.ds__extract_day AS metric_time__extract_day - , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_24.ds__extract_dow AS metric_time__extract_dow + , subq_24.ds__extract_doy AS metric_time__extract_doy , subq_24.listing , subq_24.guest , subq_24.host @@ -988,74 +988,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql index 0512790e47..61d8df3842 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_reused_measure__plan0.sql @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -74,8 +74,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -86,8 +86,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,8 +122,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -168,74 +168,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -282,8 +282,8 @@ FROM ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month @@ -294,8 +294,8 @@ FROM ( , subq_7.ds_partitioned__extract_month , subq_7.ds_partitioned__extract_week , subq_7.ds_partitioned__extract_day - , subq_7.ds_partitioned__extract_dayofweek - , subq_7.ds_partitioned__extract_dayofyear + , subq_7.ds_partitioned__extract_dow + , subq_7.ds_partitioned__extract_doy , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month @@ -306,8 +306,8 @@ FROM ( , subq_7.paid_at__extract_month , subq_7.paid_at__extract_week , subq_7.paid_at__extract_day - , subq_7.paid_at__extract_dayofweek - , subq_7.paid_at__extract_dayofyear + , subq_7.paid_at__extract_dow + , subq_7.paid_at__extract_doy , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month @@ -318,8 +318,8 @@ FROM ( , subq_7.booking__ds__extract_month , subq_7.booking__ds__extract_week , subq_7.booking__ds__extract_day - , subq_7.booking__ds__extract_dayofweek - , subq_7.booking__ds__extract_dayofyear + , subq_7.booking__ds__extract_dow + , subq_7.booking__ds__extract_doy , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month @@ -330,8 +330,8 @@ FROM ( , subq_7.booking__ds_partitioned__extract_month , subq_7.booking__ds_partitioned__extract_week , subq_7.booking__ds_partitioned__extract_day - , subq_7.booking__ds_partitioned__extract_dayofweek - , subq_7.booking__ds_partitioned__extract_dayofyear + , subq_7.booking__ds_partitioned__extract_dow + , subq_7.booking__ds_partitioned__extract_doy , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month @@ -342,8 +342,8 @@ FROM ( , subq_7.booking__paid_at__extract_month , subq_7.booking__paid_at__extract_week , subq_7.booking__paid_at__extract_day - , subq_7.booking__paid_at__extract_dayofweek - , subq_7.booking__paid_at__extract_dayofyear + , subq_7.booking__paid_at__extract_dow + , subq_7.booking__paid_at__extract_doy , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -354,8 +354,8 @@ FROM ( , subq_7.ds__extract_month AS metric_time__extract_month , subq_7.ds__extract_week AS metric_time__extract_week , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -400,74 +400,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 2d8a10e755..bd41d48bd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -44,8 +44,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -56,8 +56,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -68,8 +68,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,8 +116,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -162,74 +162,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index f000943d3d..edfbb1483f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -256,8 +256,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month @@ -268,8 +268,8 @@ FROM ( , subq_5.created_at__extract_month , subq_5.created_at__extract_week , subq_5.created_at__extract_day - , subq_5.created_at__extract_dayofweek - , subq_5.created_at__extract_dayofyear + , subq_5.created_at__extract_dow + , subq_5.created_at__extract_doy , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month @@ -280,8 +280,8 @@ FROM ( , subq_5.listing__ds__extract_month , subq_5.listing__ds__extract_week , subq_5.listing__ds__extract_day - , subq_5.listing__ds__extract_dayofweek - , subq_5.listing__ds__extract_dayofyear + , subq_5.listing__ds__extract_dow + , subq_5.listing__ds__extract_doy , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_5.listing__created_at__extract_month , subq_5.listing__created_at__extract_week , subq_5.listing__created_at__extract_day - , subq_5.listing__created_at__extract_dayofweek - , subq_5.listing__created_at__extract_dayofyear + , subq_5.listing__created_at__extract_dow + , subq_5.listing__created_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -304,8 +304,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.user , subq_5.listing__user @@ -329,25 +329,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -356,25 +356,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql index db50a9f2c8..d1740a6a39 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -250,8 +250,8 @@ FROM ( , subq_3.window_start__extract_month AS window_start__extract_month , subq_3.window_start__extract_week AS window_start__extract_week , subq_3.window_start__extract_day AS window_start__extract_day - , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek - , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear + , subq_3.window_start__extract_dow AS window_start__extract_dow + , subq_3.window_start__extract_doy AS window_start__extract_doy , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month @@ -262,8 +262,8 @@ FROM ( , subq_3.window_end__extract_month AS window_end__extract_month , subq_3.window_end__extract_week AS window_end__extract_week , subq_3.window_end__extract_day AS window_end__extract_day - , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek - , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear + , subq_3.window_end__extract_dow AS window_end__extract_dow + , subq_3.window_end__extract_doy AS window_end__extract_doy , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month @@ -274,8 +274,8 @@ FROM ( , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day - , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek - , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_3.listing__window_start__extract_dow AS listing__window_start__extract_dow + , subq_3.listing__window_start__extract_doy AS listing__window_start__extract_doy , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day - , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek - , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_3.listing__window_end__extract_dow AS listing__window_end__extract_dow + , subq_3.listing__window_end__extract_doy AS listing__window_end__extract_doy , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month @@ -298,8 +298,8 @@ FROM ( , subq_5.ds__extract_month AS user__ds__extract_month , subq_5.ds__extract_week AS user__ds__extract_week , subq_5.ds__extract_day AS user__ds__extract_day - , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek - , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear + , subq_5.ds__extract_dow AS user__ds__extract_dow + , subq_5.ds__extract_doy AS user__ds__extract_doy , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -318,25 +318,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -345,25 +345,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -412,8 +412,8 @@ FROM ( , subq_4.ds__extract_month , subq_4.ds__extract_week , subq_4.ds__extract_day - , subq_4.ds__extract_dayofweek - , subq_4.ds__extract_dayofyear + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month @@ -424,8 +424,8 @@ FROM ( , subq_4.user__ds__extract_month , subq_4.user__ds__extract_week , subq_4.user__ds__extract_day - , subq_4.user__ds__extract_dayofweek - , subq_4.user__ds__extract_dayofyear + , subq_4.user__ds__extract_dow + , subq_4.user__ds__extract_doy , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -437,26 +437,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql index adaf16cf58..8abc633b9a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -253,8 +253,8 @@ FROM ( , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day - , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek - , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear + , subq_5.window_start__extract_dow AS lux_listing__window_start__extract_dow + , subq_5.window_start__extract_doy AS lux_listing__window_start__extract_doy , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month @@ -265,8 +265,8 @@ FROM ( , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day - , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek - , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear + , subq_5.window_end__extract_dow AS lux_listing__window_end__extract_dow + , subq_5.window_end__extract_doy AS lux_listing__window_end__extract_doy , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -343,8 +343,8 @@ FROM ( , subq_4.window_start__extract_month , subq_4.window_start__extract_week , subq_4.window_start__extract_day - , subq_4.window_start__extract_dayofweek - , subq_4.window_start__extract_dayofyear + , subq_4.window_start__extract_dow + , subq_4.window_start__extract_doy , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month @@ -355,8 +355,8 @@ FROM ( , subq_4.window_end__extract_month , subq_4.window_end__extract_week , subq_4.window_end__extract_day - , subq_4.window_end__extract_dayofweek - , subq_4.window_end__extract_dayofyear + , subq_4.window_end__extract_dow + , subq_4.window_end__extract_doy , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month @@ -367,8 +367,8 @@ FROM ( , subq_4.lux_listing__window_start__extract_month , subq_4.lux_listing__window_start__extract_week , subq_4.lux_listing__window_start__extract_day - , subq_4.lux_listing__window_start__extract_dayofweek - , subq_4.lux_listing__window_start__extract_dayofyear + , subq_4.lux_listing__window_start__extract_dow + , subq_4.lux_listing__window_start__extract_doy , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month @@ -379,8 +379,8 @@ FROM ( , subq_4.lux_listing__window_end__extract_month , subq_4.lux_listing__window_end__extract_week , subq_4.lux_listing__window_end__extract_day - , subq_4.lux_listing__window_end__extract_dayofweek - , subq_4.lux_listing__window_end__extract_dayofyear + , subq_4.lux_listing__window_end__extract_dow + , subq_4.lux_listing__window_end__extract_doy , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -392,50 +392,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql index cb9670f074..7e38380b20 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_join_node__plan0.sql @@ -33,74 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -127,25 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -154,25 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -201,25 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -228,25 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql index 7638105966..99d4dba7cb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.account_id__ds_partitioned__day , subq_0.account_id__ds_partitioned__week , subq_0.account_id__ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.account_id__ds_partitioned__extract_month , subq_0.account_id__ds_partitioned__extract_week , subq_0.account_id__ds_partitioned__extract_day - , subq_0.account_id__ds_partitioned__extract_dayofweek - , subq_0.account_id__ds_partitioned__extract_dayofyear + , subq_0.account_id__ds_partitioned__extract_dow + , subq_0.account_id__ds_partitioned__extract_doy , subq_0.account_id__ds__day , subq_0.account_id__ds__week , subq_0.account_id__ds__month @@ -77,8 +77,8 @@ FROM ( , subq_0.account_id__ds__extract_month , subq_0.account_id__ds__extract_week , subq_0.account_id__ds__extract_day - , subq_0.account_id__ds__extract_dayofweek - , subq_0.account_id__ds__extract_dayofyear + , subq_0.account_id__ds__extract_dow + , subq_0.account_id__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month @@ -104,50 +104,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -174,8 +174,8 @@ FROM ( , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_3.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_3.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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 @@ -186,8 +186,8 @@ FROM ( , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day - , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek - , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear + , subq_3.account_id__ds_partitioned__extract_dow AS account_id__ds_partitioned__extract_dow + , subq_3.account_id__ds_partitioned__extract_doy AS account_id__ds_partitioned__extract_doy , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month @@ -198,8 +198,8 @@ FROM ( , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow AS customer_id__ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy AS customer_id__ds_partitioned__extract_doy , 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 @@ -216,26 +216,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -283,8 +283,8 @@ FROM ( , subq_4.ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy , subq_4.customer_id__ds_partitioned__day , subq_4.customer_id__ds_partitioned__week , subq_4.customer_id__ds_partitioned__month @@ -295,8 +295,8 @@ FROM ( , subq_4.customer_id__ds_partitioned__extract_month , subq_4.customer_id__ds_partitioned__extract_week , subq_4.customer_id__ds_partitioned__extract_day - , subq_4.customer_id__ds_partitioned__extract_dayofweek - , subq_4.customer_id__ds_partitioned__extract_dayofyear + , subq_4.customer_id__ds_partitioned__extract_dow + , subq_4.customer_id__ds_partitioned__extract_doy , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -312,13 +312,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -326,13 +326,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql index 3d8fba9b22..54b108dd33 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multiple_metrics_no_dimensions__plan0.sql @@ -28,8 +28,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month @@ -40,8 +40,8 @@ FROM ( , subq_1.ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month @@ -52,8 +52,8 @@ FROM ( , subq_1.paid_at__extract_month , subq_1.paid_at__extract_week , subq_1.paid_at__extract_day - , subq_1.paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow + , subq_1.paid_at__extract_doy , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month @@ -64,8 +64,8 @@ FROM ( , subq_1.booking__ds__extract_month , subq_1.booking__ds__extract_week , subq_1.booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow + , subq_1.booking__ds__extract_doy , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month @@ -76,8 +76,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month @@ -88,8 +88,8 @@ FROM ( , subq_1.booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -100,8 +100,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.listing , subq_1.guest , subq_1.host @@ -136,8 +136,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -160,8 +160,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -172,8 +172,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -196,8 +196,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -208,8 +208,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -254,74 +254,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -362,8 +362,8 @@ CROSS JOIN ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month @@ -374,8 +374,8 @@ CROSS JOIN ( , subq_7.created_at__extract_month , subq_7.created_at__extract_week , subq_7.created_at__extract_day - , subq_7.created_at__extract_dayofweek - , subq_7.created_at__extract_dayofyear + , subq_7.created_at__extract_dow + , subq_7.created_at__extract_doy , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month @@ -386,8 +386,8 @@ CROSS JOIN ( , subq_7.listing__ds__extract_month , subq_7.listing__ds__extract_week , subq_7.listing__ds__extract_day - , subq_7.listing__ds__extract_dayofweek - , subq_7.listing__ds__extract_dayofyear + , subq_7.listing__ds__extract_dow + , subq_7.listing__ds__extract_doy , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month @@ -398,8 +398,8 @@ CROSS JOIN ( , subq_7.listing__created_at__extract_month , subq_7.listing__created_at__extract_week , subq_7.listing__created_at__extract_day - , subq_7.listing__created_at__extract_dayofweek - , subq_7.listing__created_at__extract_dayofyear + , subq_7.listing__created_at__extract_dow + , subq_7.listing__created_at__extract_doy , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -410,8 +410,8 @@ CROSS JOIN ( , subq_7.metric_time__extract_month , subq_7.metric_time__extract_week , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dayofweek - , subq_7.metric_time__extract_dayofyear + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.user , subq_7.listing__user @@ -437,8 +437,8 @@ CROSS JOIN ( , subq_6.ds__extract_month , subq_6.ds__extract_week , subq_6.ds__extract_day - , subq_6.ds__extract_dayofweek - , subq_6.ds__extract_dayofyear + , subq_6.ds__extract_dow + , subq_6.ds__extract_doy , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month @@ -449,8 +449,8 @@ CROSS JOIN ( , subq_6.created_at__extract_month , subq_6.created_at__extract_week , subq_6.created_at__extract_day - , subq_6.created_at__extract_dayofweek - , subq_6.created_at__extract_dayofyear + , subq_6.created_at__extract_dow + , subq_6.created_at__extract_doy , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month @@ -461,8 +461,8 @@ CROSS JOIN ( , subq_6.listing__ds__extract_month , subq_6.listing__ds__extract_week , subq_6.listing__ds__extract_day - , subq_6.listing__ds__extract_dayofweek - , subq_6.listing__ds__extract_dayofyear + , subq_6.listing__ds__extract_dow + , subq_6.listing__ds__extract_doy , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month @@ -473,8 +473,8 @@ CROSS JOIN ( , subq_6.listing__created_at__extract_month , subq_6.listing__created_at__extract_week , subq_6.listing__created_at__extract_day - , subq_6.listing__created_at__extract_dayofweek - , subq_6.listing__created_at__extract_dayofyear + , subq_6.listing__created_at__extract_dow + , subq_6.listing__created_at__extract_doy , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -485,8 +485,8 @@ CROSS JOIN ( , subq_6.ds__extract_month AS metric_time__extract_month , subq_6.ds__extract_week AS metric_time__extract_week , subq_6.ds__extract_day AS metric_time__extract_day - , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_6.ds__extract_dow AS metric_time__extract_dow + , subq_6.ds__extract_doy AS metric_time__extract_doy , subq_6.listing , subq_6.user , subq_6.listing__user @@ -510,25 +510,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -537,25 +537,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql index 138d3b47ca..a716977aaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_nested_derived_metric__plan0.sql @@ -49,8 +49,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -73,8 +73,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -109,8 +109,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -121,8 +121,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -167,74 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -278,8 +278,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -290,8 +290,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -302,8 +302,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -338,8 +338,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -350,8 +350,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -396,74 +396,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -519,8 +519,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -531,8 +531,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -543,8 +543,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -555,8 +555,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -567,8 +567,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -579,8 +579,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -591,8 +591,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -637,74 +637,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -758,8 +758,8 @@ FROM ( , subq_17.ds__extract_month , subq_17.ds__extract_week , subq_17.ds__extract_day - , subq_17.ds__extract_dayofweek - , subq_17.ds__extract_dayofyear + , subq_17.ds__extract_dow + , subq_17.ds__extract_doy , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month @@ -770,8 +770,8 @@ FROM ( , subq_17.ds_partitioned__extract_month , subq_17.ds_partitioned__extract_week , subq_17.ds_partitioned__extract_day - , subq_17.ds_partitioned__extract_dayofweek - , subq_17.ds_partitioned__extract_dayofyear + , subq_17.ds_partitioned__extract_dow + , subq_17.ds_partitioned__extract_doy , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month @@ -782,8 +782,8 @@ FROM ( , subq_17.paid_at__extract_month , subq_17.paid_at__extract_week , subq_17.paid_at__extract_day - , subq_17.paid_at__extract_dayofweek - , subq_17.paid_at__extract_dayofyear + , subq_17.paid_at__extract_dow + , subq_17.paid_at__extract_doy , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month @@ -794,8 +794,8 @@ FROM ( , subq_17.booking__ds__extract_month , subq_17.booking__ds__extract_week , subq_17.booking__ds__extract_day - , subq_17.booking__ds__extract_dayofweek - , subq_17.booking__ds__extract_dayofyear + , subq_17.booking__ds__extract_dow + , subq_17.booking__ds__extract_doy , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month @@ -806,8 +806,8 @@ FROM ( , subq_17.booking__ds_partitioned__extract_month , subq_17.booking__ds_partitioned__extract_week , subq_17.booking__ds_partitioned__extract_day - , subq_17.booking__ds_partitioned__extract_dayofweek - , subq_17.booking__ds_partitioned__extract_dayofyear + , subq_17.booking__ds_partitioned__extract_dow + , subq_17.booking__ds_partitioned__extract_doy , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month @@ -818,8 +818,8 @@ FROM ( , subq_17.booking__paid_at__extract_month , subq_17.booking__paid_at__extract_week , subq_17.booking__paid_at__extract_day - , subq_17.booking__paid_at__extract_dayofweek - , subq_17.booking__paid_at__extract_dayofyear + , subq_17.booking__paid_at__extract_dow + , subq_17.booking__paid_at__extract_doy , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -830,8 +830,8 @@ FROM ( , subq_17.ds__extract_month AS metric_time__extract_month , subq_17.ds__extract_week AS metric_time__extract_week , subq_17.ds__extract_day AS metric_time__extract_day - , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_17.ds__extract_dow AS metric_time__extract_dow + , subq_17.ds__extract_doy AS metric_time__extract_doy , subq_17.listing , subq_17.guest , subq_17.host @@ -876,74 +876,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql index 63116a5458..d6632b499f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_order_by_node__plan0.sql @@ -45,74 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql index e43e265eff..44cff4ab94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_partitioned_join__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month @@ -65,8 +65,8 @@ FROM ( , subq_0.verification__ds__extract_month , subq_0.verification__ds__extract_week , subq_0.verification__ds__extract_day - , subq_0.verification__ds__extract_dayofweek - , subq_0.verification__ds__extract_dayofyear + , subq_0.verification__ds__extract_dow + , subq_0.verification__ds__extract_doy , subq_0.verification__ds_partitioned__day , subq_0.verification__ds_partitioned__week , subq_0.verification__ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.verification__ds_partitioned__extract_month , subq_0.verification__ds_partitioned__extract_week , subq_0.verification__ds_partitioned__extract_day - , subq_0.verification__ds_partitioned__extract_dayofweek - , subq_0.verification__ds_partitioned__extract_dayofyear + , subq_0.verification__ds_partitioned__extract_dow + , subq_0.verification__ds_partitioned__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.verification , subq_0.user , subq_0.verification__user @@ -106,50 +106,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -173,74 +173,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql index d88d2d32f3..33fc914795 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -82,26 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql index 094486f462..d90abbd294 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql index a8a26c9899..dc98b44d95 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index c400372dd4..d723157d2a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 30ab4c1851..95274f2863 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ef337f422c..e0c877bdf1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql index 16b897731d..9c6e0a2676 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_single_join_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -125,25 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -152,25 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql index 7dd5c3b39d..b9ae7f84a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql index e240956212..d1560d9ab0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_source_node__plan0_optimized.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql index d2a3c6afd9..b954d8927e 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_common_semantic_model__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -379,74 +379,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql index c80b16baf0..b1bf877e84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index c45302afaf..5373f3b9a9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -56,8 +56,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -68,8 +68,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -80,8 +80,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -116,8 +116,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -128,8 +128,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -174,74 +174,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -271,8 +271,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -283,8 +283,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -295,8 +295,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -307,8 +307,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -319,8 +319,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -344,25 +344,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,25 +371,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -455,8 +455,8 @@ FROM ( , subq_10.ds__extract_month , subq_10.ds__extract_week , subq_10.ds__extract_day - , subq_10.ds__extract_dayofweek - , subq_10.ds__extract_dayofyear + , subq_10.ds__extract_dow + , subq_10.ds__extract_doy , subq_10.ds_partitioned__day , subq_10.ds_partitioned__week , subq_10.ds_partitioned__month @@ -467,8 +467,8 @@ FROM ( , subq_10.ds_partitioned__extract_month , subq_10.ds_partitioned__extract_week , subq_10.ds_partitioned__extract_day - , subq_10.ds_partitioned__extract_dayofweek - , subq_10.ds_partitioned__extract_dayofyear + , subq_10.ds_partitioned__extract_dow + , subq_10.ds_partitioned__extract_doy , subq_10.view__ds__day , subq_10.view__ds__week , subq_10.view__ds__month @@ -479,8 +479,8 @@ FROM ( , subq_10.view__ds__extract_month , subq_10.view__ds__extract_week , subq_10.view__ds__extract_day - , subq_10.view__ds__extract_dayofweek - , subq_10.view__ds__extract_dayofyear + , subq_10.view__ds__extract_dow + , subq_10.view__ds__extract_doy , subq_10.view__ds_partitioned__day , subq_10.view__ds_partitioned__week , subq_10.view__ds_partitioned__month @@ -491,8 +491,8 @@ FROM ( , subq_10.view__ds_partitioned__extract_month , subq_10.view__ds_partitioned__extract_week , subq_10.view__ds_partitioned__extract_day - , subq_10.view__ds_partitioned__extract_dayofweek - , subq_10.view__ds_partitioned__extract_dayofyear + , subq_10.view__ds_partitioned__extract_dow + , subq_10.view__ds_partitioned__extract_doy , subq_10.ds__day AS metric_time__day , subq_10.ds__week AS metric_time__week , subq_10.ds__month AS metric_time__month @@ -503,8 +503,8 @@ FROM ( , subq_10.ds__extract_month AS metric_time__extract_month , subq_10.ds__extract_week AS metric_time__extract_week , subq_10.ds__extract_day AS metric_time__extract_day - , subq_10.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_10.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_10.ds__extract_dow AS metric_time__extract_dow + , subq_10.ds__extract_doy AS metric_time__extract_doy , subq_10.listing , subq_10.user , subq_10.view__listing @@ -519,49 +519,49 @@ FROM ( , DATE_TRUNC('month', views_source_src_10009.ds) AS ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC('week', views_source_src_10009.ds) AS view__ds__week , DATE_TRUNC('month', views_source_src_10009.ds) AS view__ds__month , DATE_TRUNC('quarter', views_source_src_10009.ds) AS view__ds__quarter , DATE_TRUNC('year', views_source_src_10009.ds) AS view__ds__year - , EXTRACT(YEAR FROM views_source_src_10009.ds) AS view__ds__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds) AS view__ds__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds) AS view__ds__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month + , EXTRACT(week FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC('week', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__week , DATE_TRUNC('month', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__month , DATE_TRUNC('quarter', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__quarter , DATE_TRUNC('year', views_source_src_10009.ds_partitioned) AS view__ds_partitioned__year - , EXTRACT(YEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(WEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week - , EXTRACT(DAY FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year + , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter + , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month + , EXTRACT(week FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day + , EXTRACT(dow FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(doy FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -589,8 +589,8 @@ FROM ( , subq_13.ds__extract_month , subq_13.ds__extract_week , subq_13.ds__extract_day - , subq_13.ds__extract_dayofweek - , subq_13.ds__extract_dayofyear + , subq_13.ds__extract_dow + , subq_13.ds__extract_doy , subq_13.created_at__day , subq_13.created_at__week , subq_13.created_at__month @@ -601,8 +601,8 @@ FROM ( , subq_13.created_at__extract_month , subq_13.created_at__extract_week , subq_13.created_at__extract_day - , subq_13.created_at__extract_dayofweek - , subq_13.created_at__extract_dayofyear + , subq_13.created_at__extract_dow + , subq_13.created_at__extract_doy , subq_13.listing__ds__day , subq_13.listing__ds__week , subq_13.listing__ds__month @@ -613,8 +613,8 @@ FROM ( , subq_13.listing__ds__extract_month , subq_13.listing__ds__extract_week , subq_13.listing__ds__extract_day - , subq_13.listing__ds__extract_dayofweek - , subq_13.listing__ds__extract_dayofyear + , subq_13.listing__ds__extract_dow + , subq_13.listing__ds__extract_doy , subq_13.listing__created_at__day , subq_13.listing__created_at__week , subq_13.listing__created_at__month @@ -625,8 +625,8 @@ FROM ( , subq_13.listing__created_at__extract_month , subq_13.listing__created_at__extract_week , subq_13.listing__created_at__extract_day - , subq_13.listing__created_at__extract_dayofweek - , subq_13.listing__created_at__extract_dayofyear + , subq_13.listing__created_at__extract_dow + , subq_13.listing__created_at__extract_doy , subq_13.ds__day AS metric_time__day , subq_13.ds__week AS metric_time__week , subq_13.ds__month AS metric_time__month @@ -637,8 +637,8 @@ FROM ( , subq_13.ds__extract_month AS metric_time__extract_month , subq_13.ds__extract_week AS metric_time__extract_week , subq_13.ds__extract_day AS metric_time__extract_day - , subq_13.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_13.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_13.ds__extract_dow AS metric_time__extract_dow + , subq_13.ds__extract_doy AS metric_time__extract_doy , subq_13.listing , subq_13.user , subq_13.listing__user @@ -662,25 +662,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -689,25 +689,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index a56183e745..1bd176c115 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -47,74 +47,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,25 +141,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,25 +168,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql index b6f01861d7..cd879426f7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_compute_metrics_node_simple_expr__plan0.sql @@ -44,74 +44,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -138,25 +138,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -165,25 +165,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql index d480357663..5b6dd99cc4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_constrain_time_range_node__plan0.sql @@ -38,74 +38,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql index ad08f90e35..6920a36691 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql index 8c2ab1a915..4080ab9420 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_grain_to_date__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql index 8d5b07c69a..fcf74a5947 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_ds__plan0.sql @@ -23,8 +23,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -35,8 +35,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -61,25 +61,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql index d98f0f554a..0143335613 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -64,25 +64,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 26ab44afcc..5cba3a3202 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql index a670ac2189..414159089b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_cumulative_metric_with_time_constraint__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.company__ds__day , subq_1.company__ds__week , subq_1.company__ds__month @@ -38,8 +38,8 @@ FROM ( , subq_1.company__ds__extract_month , subq_1.company__ds__extract_week , subq_1.company__ds__extract_day - , subq_1.company__ds__extract_dayofweek - , subq_1.company__ds__extract_dayofyear + , subq_1.company__ds__extract_dow + , subq_1.company__ds__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -50,8 +50,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.user , subq_1.company__user , subq_1.txn_revenue @@ -68,8 +68,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.company__ds__day , subq_0.company__ds__week , subq_0.company__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.company__ds__extract_month , subq_0.company__ds__extract_week , subq_0.company__ds__extract_day - , subq_0.company__ds__extract_dayofweek - , subq_0.company__ds__extract_dayofyear + , subq_0.company__ds__extract_dow + , subq_0.company__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -92,8 +92,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.user , subq_0.company__user , subq_0.txn_revenue @@ -106,25 +106,25 @@ FROM ( , DATE_TRUNC('month', revenue_src_10006.created_at) AS ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC('week', revenue_src_10006.created_at) AS company__ds__week , DATE_TRUNC('month', revenue_src_10006.created_at) AS company__ds__month , DATE_TRUNC('quarter', revenue_src_10006.created_at) AS company__ds__quarter , DATE_TRUNC('year', revenue_src_10006.created_at) AS company__ds__year - , EXTRACT(YEAR FROM revenue_src_10006.created_at) AS company__ds__extract_year - , EXTRACT(QUARTER FROM revenue_src_10006.created_at) AS company__ds__extract_quarter - , EXTRACT(MONTH FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(WEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week - , EXTRACT(DAY FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_dayofyear + , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year + , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter + , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month + , EXTRACT(week FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day + , EXTRACT(dow FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(doy FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql index 3d88c96009..5b4011175d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -266,8 +266,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -278,8 +278,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -290,8 +290,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -302,8 +302,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -338,8 +338,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -384,74 +384,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql index e2ff275b47..d11a69936d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 13d462ce84..b98d6d0f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql index e3607ad97a..9139bc862d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 71e89d4432..0022a4f526 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -37,8 +37,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -49,8 +49,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -61,8 +61,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -73,8 +73,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -109,8 +109,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -155,74 +155,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -267,8 +267,8 @@ FROM ( , subq_6.ds__extract_month AS ds__extract_month , subq_6.ds__extract_week AS ds__extract_week , subq_6.ds__extract_day AS ds__extract_day - , subq_6.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_6.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy , subq_6.ds_partitioned__day AS ds_partitioned__day , subq_6.ds_partitioned__week AS ds_partitioned__week , subq_6.ds_partitioned__month AS ds_partitioned__month @@ -279,8 +279,8 @@ FROM ( , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_6.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_6.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_6.paid_at__day AS paid_at__day , subq_6.paid_at__week AS paid_at__week , subq_6.paid_at__month AS paid_at__month @@ -291,8 +291,8 @@ FROM ( , subq_6.paid_at__extract_month AS paid_at__extract_month , subq_6.paid_at__extract_week AS paid_at__extract_week , subq_6.paid_at__extract_day AS paid_at__extract_day - , subq_6.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_6.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy , subq_6.booking__ds__day AS booking__ds__day , subq_6.booking__ds__week AS booking__ds__week , subq_6.booking__ds__month AS booking__ds__month @@ -303,8 +303,8 @@ FROM ( , subq_6.booking__ds__extract_month AS booking__ds__extract_month , subq_6.booking__ds__extract_week AS booking__ds__extract_week , subq_6.booking__ds__extract_day AS booking__ds__extract_day - , subq_6.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_6.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -315,8 +315,8 @@ FROM ( , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_6.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_6.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_6.booking__paid_at__day AS booking__paid_at__day , subq_6.booking__paid_at__week AS booking__paid_at__week , subq_6.booking__paid_at__month AS booking__paid_at__month @@ -327,8 +327,8 @@ FROM ( , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_6.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_6.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_6.listing AS listing , subq_6.guest AS guest , subq_6.host AS host @@ -369,8 +369,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -381,8 +381,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -393,8 +393,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -405,8 +405,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -417,8 +417,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -429,8 +429,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -441,8 +441,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -487,74 +487,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 9967c13e88..10bb6c0450 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -373,8 +373,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -385,8 +385,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -397,8 +397,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -409,8 +409,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -421,8 +421,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -433,8 +433,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -475,8 +475,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -487,8 +487,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -499,8 +499,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -511,8 +511,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -523,8 +523,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -535,8 +535,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -547,8 +547,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -593,74 +593,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index b76e01d113..1aaa96b40a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -38,8 +38,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -50,8 +50,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -62,8 +62,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -74,8 +74,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -86,8 +86,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -98,8 +98,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -140,8 +140,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -152,8 +152,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -164,8 +164,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -176,8 +176,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -188,8 +188,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -200,8 +200,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -212,8 +212,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -258,74 +258,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -374,8 +374,8 @@ FROM ( , subq_9.ds__extract_month AS ds__extract_month , subq_9.ds__extract_week AS ds__extract_week , subq_9.ds__extract_day AS ds__extract_day - , subq_9.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_9.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_9.ds__extract_dow AS ds__extract_dow + , subq_9.ds__extract_doy AS ds__extract_doy , subq_9.ds_partitioned__day AS ds_partitioned__day , subq_9.ds_partitioned__week AS ds_partitioned__week , subq_9.ds_partitioned__month AS ds_partitioned__month @@ -386,8 +386,8 @@ FROM ( , subq_9.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_9.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_9.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_9.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_9.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_9.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_9.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_9.paid_at__day AS paid_at__day , subq_9.paid_at__week AS paid_at__week , subq_9.paid_at__month AS paid_at__month @@ -398,8 +398,8 @@ FROM ( , subq_9.paid_at__extract_month AS paid_at__extract_month , subq_9.paid_at__extract_week AS paid_at__extract_week , subq_9.paid_at__extract_day AS paid_at__extract_day - , subq_9.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_9.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_9.paid_at__extract_dow AS paid_at__extract_dow + , subq_9.paid_at__extract_doy AS paid_at__extract_doy , subq_9.booking__ds__day AS booking__ds__day , subq_9.booking__ds__week AS booking__ds__week , subq_9.booking__ds__month AS booking__ds__month @@ -410,8 +410,8 @@ FROM ( , subq_9.booking__ds__extract_month AS booking__ds__extract_month , subq_9.booking__ds__extract_week AS booking__ds__extract_week , subq_9.booking__ds__extract_day AS booking__ds__extract_day - , subq_9.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_9.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_9.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_9.booking__ds__extract_doy AS booking__ds__extract_doy , subq_9.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_9.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_9.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -422,8 +422,8 @@ FROM ( , subq_9.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_9.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_9.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_9.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_9.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_9.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_9.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_9.booking__paid_at__day AS booking__paid_at__day , subq_9.booking__paid_at__week AS booking__paid_at__week , subq_9.booking__paid_at__month AS booking__paid_at__month @@ -434,8 +434,8 @@ FROM ( , subq_9.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_9.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_9.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_9.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_9.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_9.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_9.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_9.listing AS listing , subq_9.guest AS guest , subq_9.host AS host @@ -476,8 +476,8 @@ FROM ( , subq_8.ds__extract_month , subq_8.ds__extract_week , subq_8.ds__extract_day - , subq_8.ds__extract_dayofweek - , subq_8.ds__extract_dayofyear + , subq_8.ds__extract_dow + , subq_8.ds__extract_doy , subq_8.ds_partitioned__day , subq_8.ds_partitioned__week , subq_8.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_8.ds_partitioned__extract_month , subq_8.ds_partitioned__extract_week , subq_8.ds_partitioned__extract_day - , subq_8.ds_partitioned__extract_dayofweek - , subq_8.ds_partitioned__extract_dayofyear + , subq_8.ds_partitioned__extract_dow + , subq_8.ds_partitioned__extract_doy , subq_8.paid_at__day , subq_8.paid_at__week , subq_8.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_8.paid_at__extract_month , subq_8.paid_at__extract_week , subq_8.paid_at__extract_day - , subq_8.paid_at__extract_dayofweek - , subq_8.paid_at__extract_dayofyear + , subq_8.paid_at__extract_dow + , subq_8.paid_at__extract_doy , subq_8.booking__ds__day , subq_8.booking__ds__week , subq_8.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_8.booking__ds__extract_month , subq_8.booking__ds__extract_week , subq_8.booking__ds__extract_day - , subq_8.booking__ds__extract_dayofweek - , subq_8.booking__ds__extract_dayofyear + , subq_8.booking__ds__extract_dow + , subq_8.booking__ds__extract_doy , subq_8.booking__ds_partitioned__day , subq_8.booking__ds_partitioned__week , subq_8.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_8.booking__ds_partitioned__extract_month , subq_8.booking__ds_partitioned__extract_week , subq_8.booking__ds_partitioned__extract_day - , subq_8.booking__ds_partitioned__extract_dayofweek - , subq_8.booking__ds_partitioned__extract_dayofyear + , subq_8.booking__ds_partitioned__extract_dow + , subq_8.booking__ds_partitioned__extract_doy , subq_8.booking__paid_at__day , subq_8.booking__paid_at__week , subq_8.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_8.booking__paid_at__extract_month , subq_8.booking__paid_at__extract_week , subq_8.booking__paid_at__extract_day - , subq_8.booking__paid_at__extract_dayofweek - , subq_8.booking__paid_at__extract_dayofyear + , subq_8.booking__paid_at__extract_dow + , subq_8.booking__paid_at__extract_doy , subq_8.ds__day AS metric_time__day , subq_8.ds__week AS metric_time__week , subq_8.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_8.ds__extract_month AS metric_time__extract_month , subq_8.ds__extract_week AS metric_time__extract_week , subq_8.ds__extract_day AS metric_time__extract_day - , subq_8.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_8.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_8.ds__extract_dow AS metric_time__extract_dow + , subq_8.ds__extract_doy AS metric_time__extract_doy , subq_8.listing , subq_8.guest , subq_8.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql index 615aae3ac7..3107752f3d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_cumulative_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_4.ds__extract_month AS ds__extract_month , subq_4.ds__extract_week AS ds__extract_week , subq_4.ds__extract_day AS ds__extract_day - , subq_4.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_4.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_4.ds__extract_dow AS ds__extract_dow + , subq_4.ds__extract_doy AS ds__extract_doy , subq_4.ds_partitioned__day AS ds_partitioned__day , subq_4.ds_partitioned__week AS ds_partitioned__week , subq_4.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_4.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_4.paid_at__day AS paid_at__day , subq_4.paid_at__week AS paid_at__week , subq_4.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_4.paid_at__extract_month AS paid_at__extract_month , subq_4.paid_at__extract_week AS paid_at__extract_week , subq_4.paid_at__extract_day AS paid_at__extract_day - , subq_4.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_4.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_4.paid_at__extract_dow AS paid_at__extract_dow + , subq_4.paid_at__extract_doy AS paid_at__extract_doy , subq_4.booking__ds__day AS booking__ds__day , subq_4.booking__ds__week AS booking__ds__week , subq_4.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_4.booking__ds__extract_month AS booking__ds__extract_month , subq_4.booking__ds__extract_week AS booking__ds__extract_week , subq_4.booking__ds__extract_day AS booking__ds__extract_day - , subq_4.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_4.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_4.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_4.booking__ds__extract_doy AS booking__ds__extract_doy , subq_4.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_4.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_4.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_4.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_4.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_4.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_4.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_4.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_4.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_4.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_4.booking__paid_at__day AS booking__paid_at__day , subq_4.booking__paid_at__week AS booking__paid_at__week , subq_4.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_4.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_4.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_4.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_4.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_4.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_4.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_4.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_4.listing AS listing , subq_4.guest AS guest , subq_4.host AS host @@ -135,8 +135,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -147,8 +147,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -159,8 +159,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -171,8 +171,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -183,8 +183,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -195,8 +195,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.metric_time__week AS metric_time__week , subq_1.metric_time__month AS metric_time__month , subq_1.metric_time__quarter AS metric_time__quarter @@ -206,8 +206,8 @@ FROM ( , subq_1.metric_time__extract_month AS metric_time__extract_month , subq_1.metric_time__extract_week AS metric_time__extract_week , subq_1.metric_time__extract_day AS metric_time__extract_day - , subq_1.metric_time__extract_dayofweek AS metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear AS metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow AS metric_time__extract_dow + , subq_1.metric_time__extract_doy AS metric_time__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -248,8 +248,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -260,8 +260,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -272,8 +272,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -284,8 +284,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -296,8 +296,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -308,8 +308,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -320,8 +320,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -366,74 +366,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql index 6f115474ac..666e2d3376 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_1.ds__extract_month AS ds__extract_month , subq_1.ds__extract_week AS ds__extract_week , subq_1.ds__extract_day AS ds__extract_day - , subq_1.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_1.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_1.ds__extract_dow AS ds__extract_dow + , subq_1.ds__extract_doy AS ds__extract_doy , subq_1.ds_partitioned__day AS ds_partitioned__day , subq_1.ds_partitioned__week AS ds_partitioned__week , subq_1.ds_partitioned__month AS ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_1.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_1.paid_at__day AS paid_at__day , subq_1.paid_at__week AS paid_at__week , subq_1.paid_at__month AS paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_1.paid_at__extract_month AS paid_at__extract_month , subq_1.paid_at__extract_week AS paid_at__extract_week , subq_1.paid_at__extract_day AS paid_at__extract_day - , subq_1.paid_at__extract_dayofweek AS paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear AS paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow AS paid_at__extract_dow + , subq_1.paid_at__extract_doy AS paid_at__extract_doy , subq_1.booking__ds__day AS booking__ds__day , subq_1.booking__ds__week AS booking__ds__week , subq_1.booking__ds__month AS booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_1.booking__ds__extract_month AS booking__ds__extract_month , subq_1.booking__ds__extract_week AS booking__ds__extract_week , subq_1.booking__ds__extract_day AS booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek AS booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear AS booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_1.booking__ds__extract_doy AS booking__ds__extract_doy , subq_1.booking__ds_partitioned__day AS booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week AS booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month AS booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek AS booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear AS booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day AS booking__paid_at__day , subq_1.booking__paid_at__week AS booking__paid_at__week , subq_1.booking__paid_at__month AS booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_1.booking__paid_at__extract_month AS booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week AS booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day AS booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek AS booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear AS booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy AS booking__paid_at__extract_doy , subq_1.listing AS listing , subq_1.guest AS guest , subq_1.host AS host @@ -134,8 +134,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -146,8 +146,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -158,8 +158,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -170,8 +170,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -182,8 +182,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -194,8 +194,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -206,8 +206,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -252,74 +252,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql index 693e200db3..40f6785af3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_distinct_values__plan0.sql @@ -47,8 +47,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -59,8 +59,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -71,8 +71,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -83,8 +83,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -95,8 +95,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -107,8 +107,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -119,8 +119,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -165,74 +165,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -262,8 +262,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -274,8 +274,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -298,8 +298,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -310,8 +310,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -335,25 +335,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -362,25 +362,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql index 00efad0383..a43457fcbd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_node__plan0.sql @@ -25,74 +25,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql index 7e0fdff19e..a3ce23fb89 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql index 1a6844636c..70919d8caa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -77,8 +77,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -89,8 +89,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -125,8 +125,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -171,74 +171,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -268,8 +268,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -280,8 +280,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -292,8 +292,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -316,8 +316,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -341,25 +341,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -368,25 +368,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql index 5712e1d25c..6e4488a729 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_scd_dimension__plan0.sql @@ -55,8 +55,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -67,8 +67,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -79,8 +79,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -103,8 +103,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -115,8 +115,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -127,8 +127,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -159,74 +159,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -255,25 +255,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -282,25 +282,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index 141c4fba09..9f23719b49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql index a2adc126d3..1c6b0467ff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql index 7c85ab1cdb..2093e49b0b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_join_to_time_spine_node_without_offset__plan0.sql @@ -42,8 +42,8 @@ INNER JOIN ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -54,8 +54,8 @@ INNER JOIN ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -66,8 +66,8 @@ INNER JOIN ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -78,8 +78,8 @@ INNER JOIN ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -90,8 +90,8 @@ INNER JOIN ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -102,8 +102,8 @@ INNER JOIN ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -114,8 +114,8 @@ INNER JOIN ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -160,74 +160,74 @@ INNER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql index e89a957806..eb506ddf59 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_limit_rows__plan0.sql @@ -31,8 +31,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -43,8 +43,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -55,8 +55,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -67,8 +67,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -79,8 +79,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -91,8 +91,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -103,8 +103,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql index 436f0e7545..d5688f0e2d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_local_dimension_using_local_entity__plan0.sql @@ -26,8 +26,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.created_at__day , subq_0.created_at__week , subq_0.created_at__month @@ -38,8 +38,8 @@ FROM ( , subq_0.created_at__extract_month , subq_0.created_at__extract_week , subq_0.created_at__extract_day - , subq_0.created_at__extract_dayofweek - , subq_0.created_at__extract_dayofyear + , subq_0.created_at__extract_dow + , subq_0.created_at__extract_doy , subq_0.listing__ds__day , subq_0.listing__ds__week , subq_0.listing__ds__month @@ -50,8 +50,8 @@ FROM ( , subq_0.listing__ds__extract_month , subq_0.listing__ds__extract_week , subq_0.listing__ds__extract_day - , subq_0.listing__ds__extract_dayofweek - , subq_0.listing__ds__extract_dayofyear + , subq_0.listing__ds__extract_dow + , subq_0.listing__ds__extract_doy , subq_0.listing__created_at__day , subq_0.listing__created_at__week , subq_0.listing__created_at__month @@ -62,8 +62,8 @@ FROM ( , subq_0.listing__created_at__extract_month , subq_0.listing__created_at__extract_week , subq_0.listing__created_at__extract_day - , subq_0.listing__created_at__extract_dayofweek - , subq_0.listing__created_at__extract_dayofyear + , subq_0.listing__created_at__extract_dow + , subq_0.listing__created_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -74,8 +74,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.user , subq_0.listing__user @@ -99,25 +99,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -126,25 +126,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql index b05da97264..dbfcb34b94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_aggregation_node__plan0.sql @@ -35,74 +35,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql index 9223eebd6e..e5349b0d17 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint__plan0.sql @@ -65,8 +65,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -89,8 +89,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -101,8 +101,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -113,8 +113,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -125,8 +125,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -137,8 +137,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -183,74 +183,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -280,8 +280,8 @@ FROM ( , subq_3.ds__extract_month , subq_3.ds__extract_week , subq_3.ds__extract_day - , subq_3.ds__extract_dayofweek - , subq_3.ds__extract_dayofyear + , subq_3.ds__extract_dow + , subq_3.ds__extract_doy , subq_3.created_at__day , subq_3.created_at__week , subq_3.created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_3.created_at__extract_month , subq_3.created_at__extract_week , subq_3.created_at__extract_day - , subq_3.created_at__extract_dayofweek - , subq_3.created_at__extract_dayofyear + , subq_3.created_at__extract_dow + , subq_3.created_at__extract_doy , subq_3.listing__ds__day , subq_3.listing__ds__week , subq_3.listing__ds__month @@ -304,8 +304,8 @@ FROM ( , subq_3.listing__ds__extract_month , subq_3.listing__ds__extract_week , subq_3.listing__ds__extract_day - , subq_3.listing__ds__extract_dayofweek - , subq_3.listing__ds__extract_dayofyear + , subq_3.listing__ds__extract_dow + , subq_3.listing__ds__extract_doy , subq_3.listing__created_at__day , subq_3.listing__created_at__week , subq_3.listing__created_at__month @@ -316,8 +316,8 @@ FROM ( , subq_3.listing__created_at__extract_month , subq_3.listing__created_at__extract_week , subq_3.listing__created_at__extract_day - , subq_3.listing__created_at__extract_dayofweek - , subq_3.listing__created_at__extract_dayofyear + , subq_3.listing__created_at__extract_dow + , subq_3.listing__created_at__extract_doy , subq_3.ds__day AS metric_time__day , subq_3.ds__week AS metric_time__week , subq_3.ds__month AS metric_time__month @@ -328,8 +328,8 @@ FROM ( , subq_3.ds__extract_month AS metric_time__extract_month , subq_3.ds__extract_week AS metric_time__extract_week , subq_3.ds__extract_day AS metric_time__extract_day - , subq_3.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_3.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_3.ds__extract_dow AS metric_time__extract_dow + , subq_3.ds__extract_doy AS metric_time__extract_doy , subq_3.listing , subq_3.user , subq_3.listing__user @@ -353,25 +353,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -380,25 +380,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -476,8 +476,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -488,8 +488,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -500,8 +500,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -512,8 +512,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -524,8 +524,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -536,8 +536,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -548,8 +548,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -594,74 +594,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -691,8 +691,8 @@ FROM ( , subq_15.ds__extract_month , subq_15.ds__extract_week , subq_15.ds__extract_day - , subq_15.ds__extract_dayofweek - , subq_15.ds__extract_dayofyear + , subq_15.ds__extract_dow + , subq_15.ds__extract_doy , subq_15.created_at__day , subq_15.created_at__week , subq_15.created_at__month @@ -703,8 +703,8 @@ FROM ( , subq_15.created_at__extract_month , subq_15.created_at__extract_week , subq_15.created_at__extract_day - , subq_15.created_at__extract_dayofweek - , subq_15.created_at__extract_dayofyear + , subq_15.created_at__extract_dow + , subq_15.created_at__extract_doy , subq_15.listing__ds__day , subq_15.listing__ds__week , subq_15.listing__ds__month @@ -715,8 +715,8 @@ FROM ( , subq_15.listing__ds__extract_month , subq_15.listing__ds__extract_week , subq_15.listing__ds__extract_day - , subq_15.listing__ds__extract_dayofweek - , subq_15.listing__ds__extract_dayofyear + , subq_15.listing__ds__extract_dow + , subq_15.listing__ds__extract_doy , subq_15.listing__created_at__day , subq_15.listing__created_at__week , subq_15.listing__created_at__month @@ -727,8 +727,8 @@ FROM ( , subq_15.listing__created_at__extract_month , subq_15.listing__created_at__extract_week , subq_15.listing__created_at__extract_day - , subq_15.listing__created_at__extract_dayofweek - , subq_15.listing__created_at__extract_dayofyear + , subq_15.listing__created_at__extract_dow + , subq_15.listing__created_at__extract_doy , subq_15.ds__day AS metric_time__day , subq_15.ds__week AS metric_time__week , subq_15.ds__month AS metric_time__month @@ -739,8 +739,8 @@ FROM ( , subq_15.ds__extract_month AS metric_time__extract_month , subq_15.ds__extract_week AS metric_time__extract_week , subq_15.ds__extract_day AS metric_time__extract_day - , subq_15.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_15.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_15.ds__extract_dow AS metric_time__extract_dow + , subq_15.ds__extract_doy AS metric_time__extract_doy , subq_15.listing , subq_15.user , subq_15.listing__user @@ -764,25 +764,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -791,25 +791,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -870,8 +870,8 @@ FROM ( , subq_24.ds__extract_month , subq_24.ds__extract_week , subq_24.ds__extract_day - , subq_24.ds__extract_dayofweek - , subq_24.ds__extract_dayofyear + , subq_24.ds__extract_dow + , subq_24.ds__extract_doy , subq_24.ds_partitioned__day , subq_24.ds_partitioned__week , subq_24.ds_partitioned__month @@ -882,8 +882,8 @@ FROM ( , subq_24.ds_partitioned__extract_month , subq_24.ds_partitioned__extract_week , subq_24.ds_partitioned__extract_day - , subq_24.ds_partitioned__extract_dayofweek - , subq_24.ds_partitioned__extract_dayofyear + , subq_24.ds_partitioned__extract_dow + , subq_24.ds_partitioned__extract_doy , subq_24.paid_at__day , subq_24.paid_at__week , subq_24.paid_at__month @@ -894,8 +894,8 @@ FROM ( , subq_24.paid_at__extract_month , subq_24.paid_at__extract_week , subq_24.paid_at__extract_day - , subq_24.paid_at__extract_dayofweek - , subq_24.paid_at__extract_dayofyear + , subq_24.paid_at__extract_dow + , subq_24.paid_at__extract_doy , subq_24.booking__ds__day , subq_24.booking__ds__week , subq_24.booking__ds__month @@ -906,8 +906,8 @@ FROM ( , subq_24.booking__ds__extract_month , subq_24.booking__ds__extract_week , subq_24.booking__ds__extract_day - , subq_24.booking__ds__extract_dayofweek - , subq_24.booking__ds__extract_dayofyear + , subq_24.booking__ds__extract_dow + , subq_24.booking__ds__extract_doy , subq_24.booking__ds_partitioned__day , subq_24.booking__ds_partitioned__week , subq_24.booking__ds_partitioned__month @@ -918,8 +918,8 @@ FROM ( , subq_24.booking__ds_partitioned__extract_month , subq_24.booking__ds_partitioned__extract_week , subq_24.booking__ds_partitioned__extract_day - , subq_24.booking__ds_partitioned__extract_dayofweek - , subq_24.booking__ds_partitioned__extract_dayofyear + , subq_24.booking__ds_partitioned__extract_dow + , subq_24.booking__ds_partitioned__extract_doy , subq_24.booking__paid_at__day , subq_24.booking__paid_at__week , subq_24.booking__paid_at__month @@ -930,8 +930,8 @@ FROM ( , subq_24.booking__paid_at__extract_month , subq_24.booking__paid_at__extract_week , subq_24.booking__paid_at__extract_day - , subq_24.booking__paid_at__extract_dayofweek - , subq_24.booking__paid_at__extract_dayofyear + , subq_24.booking__paid_at__extract_dow + , subq_24.booking__paid_at__extract_doy , subq_24.ds__day AS metric_time__day , subq_24.ds__week AS metric_time__week , subq_24.ds__month AS metric_time__month @@ -942,8 +942,8 @@ FROM ( , subq_24.ds__extract_month AS metric_time__extract_month , subq_24.ds__extract_week AS metric_time__extract_week , subq_24.ds__extract_day AS metric_time__extract_day - , subq_24.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_24.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_24.ds__extract_dow AS metric_time__extract_dow + , subq_24.ds__extract_doy AS metric_time__extract_doy , subq_24.listing , subq_24.guest , subq_24.host @@ -988,74 +988,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql index 1f9e7a4524..c11754db0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_reused_measure__plan0.sql @@ -50,8 +50,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -62,8 +62,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -74,8 +74,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -86,8 +86,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -98,8 +98,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -110,8 +110,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -122,8 +122,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -168,74 +168,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -282,8 +282,8 @@ FROM ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.ds_partitioned__day , subq_7.ds_partitioned__week , subq_7.ds_partitioned__month @@ -294,8 +294,8 @@ FROM ( , subq_7.ds_partitioned__extract_month , subq_7.ds_partitioned__extract_week , subq_7.ds_partitioned__extract_day - , subq_7.ds_partitioned__extract_dayofweek - , subq_7.ds_partitioned__extract_dayofyear + , subq_7.ds_partitioned__extract_dow + , subq_7.ds_partitioned__extract_doy , subq_7.paid_at__day , subq_7.paid_at__week , subq_7.paid_at__month @@ -306,8 +306,8 @@ FROM ( , subq_7.paid_at__extract_month , subq_7.paid_at__extract_week , subq_7.paid_at__extract_day - , subq_7.paid_at__extract_dayofweek - , subq_7.paid_at__extract_dayofyear + , subq_7.paid_at__extract_dow + , subq_7.paid_at__extract_doy , subq_7.booking__ds__day , subq_7.booking__ds__week , subq_7.booking__ds__month @@ -318,8 +318,8 @@ FROM ( , subq_7.booking__ds__extract_month , subq_7.booking__ds__extract_week , subq_7.booking__ds__extract_day - , subq_7.booking__ds__extract_dayofweek - , subq_7.booking__ds__extract_dayofyear + , subq_7.booking__ds__extract_dow + , subq_7.booking__ds__extract_doy , subq_7.booking__ds_partitioned__day , subq_7.booking__ds_partitioned__week , subq_7.booking__ds_partitioned__month @@ -330,8 +330,8 @@ FROM ( , subq_7.booking__ds_partitioned__extract_month , subq_7.booking__ds_partitioned__extract_week , subq_7.booking__ds_partitioned__extract_day - , subq_7.booking__ds_partitioned__extract_dayofweek - , subq_7.booking__ds_partitioned__extract_dayofyear + , subq_7.booking__ds_partitioned__extract_dow + , subq_7.booking__ds_partitioned__extract_doy , subq_7.booking__paid_at__day , subq_7.booking__paid_at__week , subq_7.booking__paid_at__month @@ -342,8 +342,8 @@ FROM ( , subq_7.booking__paid_at__extract_month , subq_7.booking__paid_at__extract_week , subq_7.booking__paid_at__extract_day - , subq_7.booking__paid_at__extract_dayofweek - , subq_7.booking__paid_at__extract_dayofyear + , subq_7.booking__paid_at__extract_dow + , subq_7.booking__paid_at__extract_doy , subq_7.ds__day AS metric_time__day , subq_7.ds__week AS metric_time__week , subq_7.ds__month AS metric_time__month @@ -354,8 +354,8 @@ FROM ( , subq_7.ds__extract_month AS metric_time__extract_month , subq_7.ds__extract_week AS metric_time__extract_week , subq_7.ds__extract_day AS metric_time__extract_day - , subq_7.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_7.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_7.ds__extract_dow AS metric_time__extract_dow + , subq_7.ds__extract_doy AS metric_time__extract_doy , subq_7.listing , subq_7.guest , subq_7.host @@ -400,74 +400,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 2d8a10e755..bd41d48bd9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -44,8 +44,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -56,8 +56,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -68,8 +68,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -104,8 +104,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -116,8 +116,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -162,74 +162,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index 4ef0714be2..ecc15101fe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -256,8 +256,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.created_at__day , subq_5.created_at__week , subq_5.created_at__month @@ -268,8 +268,8 @@ FROM ( , subq_5.created_at__extract_month , subq_5.created_at__extract_week , subq_5.created_at__extract_day - , subq_5.created_at__extract_dayofweek - , subq_5.created_at__extract_dayofyear + , subq_5.created_at__extract_dow + , subq_5.created_at__extract_doy , subq_5.listing__ds__day , subq_5.listing__ds__week , subq_5.listing__ds__month @@ -280,8 +280,8 @@ FROM ( , subq_5.listing__ds__extract_month , subq_5.listing__ds__extract_week , subq_5.listing__ds__extract_day - , subq_5.listing__ds__extract_dayofweek - , subq_5.listing__ds__extract_dayofyear + , subq_5.listing__ds__extract_dow + , subq_5.listing__ds__extract_doy , subq_5.listing__created_at__day , subq_5.listing__created_at__week , subq_5.listing__created_at__month @@ -292,8 +292,8 @@ FROM ( , subq_5.listing__created_at__extract_month , subq_5.listing__created_at__extract_week , subq_5.listing__created_at__extract_day - , subq_5.listing__created_at__extract_dayofweek - , subq_5.listing__created_at__extract_dayofyear + , subq_5.listing__created_at__extract_dow + , subq_5.listing__created_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -304,8 +304,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.user , subq_5.listing__user @@ -329,25 +329,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -356,25 +356,25 @@ FROM ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql index db50a9f2c8..d1740a6a39 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -250,8 +250,8 @@ FROM ( , subq_3.window_start__extract_month AS window_start__extract_month , subq_3.window_start__extract_week AS window_start__extract_week , subq_3.window_start__extract_day AS window_start__extract_day - , subq_3.window_start__extract_dayofweek AS window_start__extract_dayofweek - , subq_3.window_start__extract_dayofyear AS window_start__extract_dayofyear + , subq_3.window_start__extract_dow AS window_start__extract_dow + , subq_3.window_start__extract_doy AS window_start__extract_doy , subq_3.window_end__day AS window_end__day , subq_3.window_end__week AS window_end__week , subq_3.window_end__month AS window_end__month @@ -262,8 +262,8 @@ FROM ( , subq_3.window_end__extract_month AS window_end__extract_month , subq_3.window_end__extract_week AS window_end__extract_week , subq_3.window_end__extract_day AS window_end__extract_day - , subq_3.window_end__extract_dayofweek AS window_end__extract_dayofweek - , subq_3.window_end__extract_dayofyear AS window_end__extract_dayofyear + , subq_3.window_end__extract_dow AS window_end__extract_dow + , subq_3.window_end__extract_doy AS window_end__extract_doy , subq_3.listing__window_start__day AS listing__window_start__day , subq_3.listing__window_start__week AS listing__window_start__week , subq_3.listing__window_start__month AS listing__window_start__month @@ -274,8 +274,8 @@ FROM ( , subq_3.listing__window_start__extract_month AS listing__window_start__extract_month , subq_3.listing__window_start__extract_week AS listing__window_start__extract_week , subq_3.listing__window_start__extract_day AS listing__window_start__extract_day - , subq_3.listing__window_start__extract_dayofweek AS listing__window_start__extract_dayofweek - , subq_3.listing__window_start__extract_dayofyear AS listing__window_start__extract_dayofyear + , subq_3.listing__window_start__extract_dow AS listing__window_start__extract_dow + , subq_3.listing__window_start__extract_doy AS listing__window_start__extract_doy , subq_3.listing__window_end__day AS listing__window_end__day , subq_3.listing__window_end__week AS listing__window_end__week , subq_3.listing__window_end__month AS listing__window_end__month @@ -286,8 +286,8 @@ FROM ( , subq_3.listing__window_end__extract_month AS listing__window_end__extract_month , subq_3.listing__window_end__extract_week AS listing__window_end__extract_week , subq_3.listing__window_end__extract_day AS listing__window_end__extract_day - , subq_3.listing__window_end__extract_dayofweek AS listing__window_end__extract_dayofweek - , subq_3.listing__window_end__extract_dayofyear AS listing__window_end__extract_dayofyear + , subq_3.listing__window_end__extract_dow AS listing__window_end__extract_dow + , subq_3.listing__window_end__extract_doy AS listing__window_end__extract_doy , subq_5.ds__day AS user__ds__day , subq_5.ds__week AS user__ds__week , subq_5.ds__month AS user__ds__month @@ -298,8 +298,8 @@ FROM ( , subq_5.ds__extract_month AS user__ds__extract_month , subq_5.ds__extract_week AS user__ds__extract_week , subq_5.ds__extract_day AS user__ds__extract_day - , subq_5.ds__extract_dayofweek AS user__ds__extract_dayofweek - , subq_5.ds__extract_dayofyear AS user__ds__extract_dayofyear + , subq_5.ds__extract_dow AS user__ds__extract_dow + , subq_5.ds__extract_doy AS user__ds__extract_doy , subq_3.listing AS listing , subq_3.user AS user , subq_3.listing__user AS listing__user @@ -318,25 +318,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -345,25 +345,25 @@ FROM ( , DATE_TRUNC('month', listings_src_10017.active_from) AS listing__window_start__month , DATE_TRUNC('quarter', listings_src_10017.active_from) AS listing__window_start__quarter , DATE_TRUNC('year', listings_src_10017.active_from) AS listing__window_start__year - , EXTRACT(YEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month + , EXTRACT(week FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day + , EXTRACT(dow FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC('week', listings_src_10017.active_to) AS listing__window_end__week , DATE_TRUNC('month', listings_src_10017.active_to) AS listing__window_end__month , DATE_TRUNC('quarter', listings_src_10017.active_to) AS listing__window_end__quarter , DATE_TRUNC('year', listings_src_10017.active_to) AS listing__window_end__year - , EXTRACT(YEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_year - , EXTRACT(QUARTER FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter - , EXTRACT(MONTH FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(WEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week - , EXTRACT(DAY FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_dayofyear + , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year + , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter + , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month + , EXTRACT(week FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day + , EXTRACT(dow FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(doy FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -412,8 +412,8 @@ FROM ( , subq_4.ds__extract_month , subq_4.ds__extract_week , subq_4.ds__extract_day - , subq_4.ds__extract_dayofweek - , subq_4.ds__extract_dayofyear + , subq_4.ds__extract_dow + , subq_4.ds__extract_doy , subq_4.user__ds__day , subq_4.user__ds__week , subq_4.user__ds__month @@ -424,8 +424,8 @@ FROM ( , subq_4.user__ds__extract_month , subq_4.user__ds__extract_week , subq_4.user__ds__extract_day - , subq_4.user__ds__extract_dayofweek - , subq_4.user__ds__extract_dayofyear + , subq_4.user__ds__extract_dow + , subq_4.user__ds__extract_doy , subq_4.user , subq_4.home_state_latest , subq_4.user__home_state_latest @@ -437,26 +437,26 @@ FROM ( , DATE_TRUNC('month', users_latest_src_10021.ds) AS ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC('week', users_latest_src_10021.ds) AS user__ds__week , DATE_TRUNC('month', users_latest_src_10021.ds) AS user__ds__month , DATE_TRUNC('quarter', users_latest_src_10021.ds) AS user__ds__quarter , DATE_TRUNC('year', users_latest_src_10021.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_latest_src_10021.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_latest_src_10021.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql index adaf16cf58..8abc633b9a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql @@ -45,8 +45,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -57,8 +57,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -69,8 +69,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -81,8 +81,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -93,8 +93,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -105,8 +105,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -117,8 +117,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -149,74 +149,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10015.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10015.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10015.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10015.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10015.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10015.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10015.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -253,8 +253,8 @@ FROM ( , subq_5.window_start__extract_month AS lux_listing__window_start__extract_month , subq_5.window_start__extract_week AS lux_listing__window_start__extract_week , subq_5.window_start__extract_day AS lux_listing__window_start__extract_day - , subq_5.window_start__extract_dayofweek AS lux_listing__window_start__extract_dayofweek - , subq_5.window_start__extract_dayofyear AS lux_listing__window_start__extract_dayofyear + , subq_5.window_start__extract_dow AS lux_listing__window_start__extract_dow + , subq_5.window_start__extract_doy AS lux_listing__window_start__extract_doy , subq_5.window_end__day AS lux_listing__window_end__day , subq_5.window_end__week AS lux_listing__window_end__week , subq_5.window_end__month AS lux_listing__window_end__month @@ -265,8 +265,8 @@ FROM ( , subq_5.window_end__extract_month AS lux_listing__window_end__extract_month , subq_5.window_end__extract_week AS lux_listing__window_end__extract_week , subq_5.window_end__extract_day AS lux_listing__window_end__extract_day - , subq_5.window_end__extract_dayofweek AS lux_listing__window_end__extract_dayofweek - , subq_5.window_end__extract_dayofyear AS lux_listing__window_end__extract_dayofyear + , subq_5.window_end__extract_dow AS lux_listing__window_end__extract_dow + , subq_5.window_end__extract_doy AS lux_listing__window_end__extract_doy , subq_3.listing AS listing , subq_3.lux_listing AS lux_listing , subq_3.listing__lux_listing AS listing__lux_listing @@ -343,8 +343,8 @@ FROM ( , subq_4.window_start__extract_month , subq_4.window_start__extract_week , subq_4.window_start__extract_day - , subq_4.window_start__extract_dayofweek - , subq_4.window_start__extract_dayofyear + , subq_4.window_start__extract_dow + , subq_4.window_start__extract_doy , subq_4.window_end__day , subq_4.window_end__week , subq_4.window_end__month @@ -355,8 +355,8 @@ FROM ( , subq_4.window_end__extract_month , subq_4.window_end__extract_week , subq_4.window_end__extract_day - , subq_4.window_end__extract_dayofweek - , subq_4.window_end__extract_dayofyear + , subq_4.window_end__extract_dow + , subq_4.window_end__extract_doy , subq_4.lux_listing__window_start__day , subq_4.lux_listing__window_start__week , subq_4.lux_listing__window_start__month @@ -367,8 +367,8 @@ FROM ( , subq_4.lux_listing__window_start__extract_month , subq_4.lux_listing__window_start__extract_week , subq_4.lux_listing__window_start__extract_day - , subq_4.lux_listing__window_start__extract_dayofweek - , subq_4.lux_listing__window_start__extract_dayofyear + , subq_4.lux_listing__window_start__extract_dow + , subq_4.lux_listing__window_start__extract_doy , subq_4.lux_listing__window_end__day , subq_4.lux_listing__window_end__week , subq_4.lux_listing__window_end__month @@ -379,8 +379,8 @@ FROM ( , subq_4.lux_listing__window_end__extract_month , subq_4.lux_listing__window_end__extract_week , subq_4.lux_listing__window_end__extract_day - , subq_4.lux_listing__window_end__extract_dayofweek - , subq_4.lux_listing__window_end__extract_dayofyear + , subq_4.lux_listing__window_end__extract_dow + , subq_4.lux_listing__window_end__extract_doy , subq_4.lux_listing , subq_4.is_confirmed_lux , subq_4.lux_listing__is_confirmed_lux @@ -392,50 +392,50 @@ FROM ( , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC('week', lux_listings_src_10019.valid_from) AS lux_listing__window_start__week , DATE_TRUNC('month', lux_listings_src_10019.valid_from) AS lux_listing__window_start__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_from) AS lux_listing__window_start__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_from) AS lux_listing__window_start__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC('week', lux_listings_src_10019.valid_to) AS lux_listing__window_end__week , DATE_TRUNC('month', lux_listings_src_10019.valid_to) AS lux_listing__window_end__month , DATE_TRUNC('quarter', lux_listings_src_10019.valid_to) AS lux_listing__window_end__quarter , DATE_TRUNC('year', lux_listings_src_10019.valid_to) AS lux_listing__window_end__year - , EXTRACT(YEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year - , EXTRACT(QUARTER FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter - , EXTRACT(MONTH FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(WEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week - , EXTRACT(DAY FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dayofyear + , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year + , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter + , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month + , EXTRACT(week FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day + , EXTRACT(dow FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(doy FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql index cb9670f074..7e38380b20 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_join_node__plan0.sql @@ -33,74 +33,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -127,25 +127,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -154,25 +154,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -201,25 +201,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -228,25 +228,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql index 7638105966..99d4dba7cb 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.ds__day , subq_0.ds__week , subq_0.ds__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.account_id__ds_partitioned__day , subq_0.account_id__ds_partitioned__week , subq_0.account_id__ds_partitioned__month @@ -65,8 +65,8 @@ FROM ( , subq_0.account_id__ds_partitioned__extract_month , subq_0.account_id__ds_partitioned__extract_week , subq_0.account_id__ds_partitioned__extract_day - , subq_0.account_id__ds_partitioned__extract_dayofweek - , subq_0.account_id__ds_partitioned__extract_dayofyear + , subq_0.account_id__ds_partitioned__extract_dow + , subq_0.account_id__ds_partitioned__extract_doy , subq_0.account_id__ds__day , subq_0.account_id__ds__week , subq_0.account_id__ds__month @@ -77,8 +77,8 @@ FROM ( , subq_0.account_id__ds__extract_month , subq_0.account_id__ds__extract_week , subq_0.account_id__ds__extract_day - , subq_0.account_id__ds__extract_dayofweek - , subq_0.account_id__ds__extract_dayofyear + , subq_0.account_id__ds__extract_dow + , subq_0.account_id__ds__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.account_id , subq_0.account_month , subq_0.account_id__account_month @@ -104,50 +104,50 @@ FROM ( , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC('week', account_month_txns_src_10010.ds) AS account_id__ds__week , DATE_TRUNC('month', account_month_txns_src_10010.ds) AS account_id__ds__month , DATE_TRUNC('quarter', account_month_txns_src_10010.ds) AS account_id__ds__quarter , DATE_TRUNC('year', account_month_txns_src_10010.ds) AS account_id__ds__year - , EXTRACT(YEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year - , EXTRACT(QUARTER FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter - , EXTRACT(MONTH FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(WEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week - , EXTRACT(DAY FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dayofyear + , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year + , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter + , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month + , EXTRACT(week FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day + , EXTRACT(dow FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(doy FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -174,8 +174,8 @@ FROM ( , subq_3.ds_partitioned__extract_month AS ds_partitioned__extract_month , subq_3.ds_partitioned__extract_week AS ds_partitioned__extract_week , subq_3.ds_partitioned__extract_day AS ds_partitioned__extract_day - , subq_3.ds_partitioned__extract_dayofweek AS ds_partitioned__extract_dayofweek - , subq_3.ds_partitioned__extract_dayofyear AS ds_partitioned__extract_dayofyear + , subq_3.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_3.ds_partitioned__extract_doy AS ds_partitioned__extract_doy , subq_3.account_id__ds_partitioned__day AS account_id__ds_partitioned__day , 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 @@ -186,8 +186,8 @@ FROM ( , subq_3.account_id__ds_partitioned__extract_month AS account_id__ds_partitioned__extract_month , subq_3.account_id__ds_partitioned__extract_week AS account_id__ds_partitioned__extract_week , subq_3.account_id__ds_partitioned__extract_day AS account_id__ds_partitioned__extract_day - , subq_3.account_id__ds_partitioned__extract_dayofweek AS account_id__ds_partitioned__extract_dayofweek - , subq_3.account_id__ds_partitioned__extract_dayofyear AS account_id__ds_partitioned__extract_dayofyear + , subq_3.account_id__ds_partitioned__extract_dow AS account_id__ds_partitioned__extract_dow + , subq_3.account_id__ds_partitioned__extract_doy AS account_id__ds_partitioned__extract_doy , subq_5.ds_partitioned__day AS customer_id__ds_partitioned__day , subq_5.ds_partitioned__week AS customer_id__ds_partitioned__week , subq_5.ds_partitioned__month AS customer_id__ds_partitioned__month @@ -198,8 +198,8 @@ FROM ( , subq_5.ds_partitioned__extract_month AS customer_id__ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week AS customer_id__ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day AS customer_id__ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek AS customer_id__ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear AS customer_id__ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow AS customer_id__ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy AS customer_id__ds_partitioned__extract_doy , 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 @@ -216,26 +216,26 @@ FROM ( , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC('week', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__week , DATE_TRUNC('month', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__month , DATE_TRUNC('quarter', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__quarter , DATE_TRUNC('year', bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__year - , EXTRACT(YEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month + , EXTRACT(week FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day + , EXTRACT(dow FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -283,8 +283,8 @@ FROM ( , subq_4.ds_partitioned__extract_month , subq_4.ds_partitioned__extract_week , subq_4.ds_partitioned__extract_day - , subq_4.ds_partitioned__extract_dayofweek - , subq_4.ds_partitioned__extract_dayofyear + , subq_4.ds_partitioned__extract_dow + , subq_4.ds_partitioned__extract_doy , subq_4.customer_id__ds_partitioned__day , subq_4.customer_id__ds_partitioned__week , subq_4.customer_id__ds_partitioned__month @@ -295,8 +295,8 @@ FROM ( , subq_4.customer_id__ds_partitioned__extract_month , subq_4.customer_id__ds_partitioned__extract_week , subq_4.customer_id__ds_partitioned__extract_day - , subq_4.customer_id__ds_partitioned__extract_dayofweek - , subq_4.customer_id__ds_partitioned__extract_dayofyear + , subq_4.customer_id__ds_partitioned__extract_dow + , subq_4.customer_id__ds_partitioned__extract_doy , subq_4.customer_id , subq_4.customer_name , subq_4.customer_atomic_weight @@ -312,13 +312,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -326,13 +326,13 @@ FROM ( , DATE_TRUNC('month', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__month , DATE_TRUNC('quarter', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__quarter , DATE_TRUNC('year', customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__year - , EXTRACT(YEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(WEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week - , EXTRACT(DAY FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year + , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter + , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month + , EXTRACT(week FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day + , EXTRACT(dow FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(doy FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql index 3d8fba9b22..54b108dd33 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multiple_metrics_no_dimensions__plan0.sql @@ -28,8 +28,8 @@ FROM ( , subq_1.ds__extract_month , subq_1.ds__extract_week , subq_1.ds__extract_day - , subq_1.ds__extract_dayofweek - , subq_1.ds__extract_dayofyear + , subq_1.ds__extract_dow + , subq_1.ds__extract_doy , subq_1.ds_partitioned__day , subq_1.ds_partitioned__week , subq_1.ds_partitioned__month @@ -40,8 +40,8 @@ FROM ( , subq_1.ds_partitioned__extract_month , subq_1.ds_partitioned__extract_week , subq_1.ds_partitioned__extract_day - , subq_1.ds_partitioned__extract_dayofweek - , subq_1.ds_partitioned__extract_dayofyear + , subq_1.ds_partitioned__extract_dow + , subq_1.ds_partitioned__extract_doy , subq_1.paid_at__day , subq_1.paid_at__week , subq_1.paid_at__month @@ -52,8 +52,8 @@ FROM ( , subq_1.paid_at__extract_month , subq_1.paid_at__extract_week , subq_1.paid_at__extract_day - , subq_1.paid_at__extract_dayofweek - , subq_1.paid_at__extract_dayofyear + , subq_1.paid_at__extract_dow + , subq_1.paid_at__extract_doy , subq_1.booking__ds__day , subq_1.booking__ds__week , subq_1.booking__ds__month @@ -64,8 +64,8 @@ FROM ( , subq_1.booking__ds__extract_month , subq_1.booking__ds__extract_week , subq_1.booking__ds__extract_day - , subq_1.booking__ds__extract_dayofweek - , subq_1.booking__ds__extract_dayofyear + , subq_1.booking__ds__extract_dow + , subq_1.booking__ds__extract_doy , subq_1.booking__ds_partitioned__day , subq_1.booking__ds_partitioned__week , subq_1.booking__ds_partitioned__month @@ -76,8 +76,8 @@ FROM ( , subq_1.booking__ds_partitioned__extract_month , subq_1.booking__ds_partitioned__extract_week , subq_1.booking__ds_partitioned__extract_day - , subq_1.booking__ds_partitioned__extract_dayofweek - , subq_1.booking__ds_partitioned__extract_dayofyear + , subq_1.booking__ds_partitioned__extract_dow + , subq_1.booking__ds_partitioned__extract_doy , subq_1.booking__paid_at__day , subq_1.booking__paid_at__week , subq_1.booking__paid_at__month @@ -88,8 +88,8 @@ FROM ( , subq_1.booking__paid_at__extract_month , subq_1.booking__paid_at__extract_week , subq_1.booking__paid_at__extract_day - , subq_1.booking__paid_at__extract_dayofweek - , subq_1.booking__paid_at__extract_dayofyear + , subq_1.booking__paid_at__extract_dow + , subq_1.booking__paid_at__extract_doy , subq_1.metric_time__day , subq_1.metric_time__week , subq_1.metric_time__month @@ -100,8 +100,8 @@ FROM ( , subq_1.metric_time__extract_month , subq_1.metric_time__extract_week , subq_1.metric_time__extract_day - , subq_1.metric_time__extract_dayofweek - , subq_1.metric_time__extract_dayofyear + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy , subq_1.listing , subq_1.guest , subq_1.host @@ -136,8 +136,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -148,8 +148,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -160,8 +160,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -172,8 +172,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -184,8 +184,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -196,8 +196,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -208,8 +208,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -254,74 +254,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -362,8 +362,8 @@ CROSS JOIN ( , subq_7.ds__extract_month , subq_7.ds__extract_week , subq_7.ds__extract_day - , subq_7.ds__extract_dayofweek - , subq_7.ds__extract_dayofyear + , subq_7.ds__extract_dow + , subq_7.ds__extract_doy , subq_7.created_at__day , subq_7.created_at__week , subq_7.created_at__month @@ -374,8 +374,8 @@ CROSS JOIN ( , subq_7.created_at__extract_month , subq_7.created_at__extract_week , subq_7.created_at__extract_day - , subq_7.created_at__extract_dayofweek - , subq_7.created_at__extract_dayofyear + , subq_7.created_at__extract_dow + , subq_7.created_at__extract_doy , subq_7.listing__ds__day , subq_7.listing__ds__week , subq_7.listing__ds__month @@ -386,8 +386,8 @@ CROSS JOIN ( , subq_7.listing__ds__extract_month , subq_7.listing__ds__extract_week , subq_7.listing__ds__extract_day - , subq_7.listing__ds__extract_dayofweek - , subq_7.listing__ds__extract_dayofyear + , subq_7.listing__ds__extract_dow + , subq_7.listing__ds__extract_doy , subq_7.listing__created_at__day , subq_7.listing__created_at__week , subq_7.listing__created_at__month @@ -398,8 +398,8 @@ CROSS JOIN ( , subq_7.listing__created_at__extract_month , subq_7.listing__created_at__extract_week , subq_7.listing__created_at__extract_day - , subq_7.listing__created_at__extract_dayofweek - , subq_7.listing__created_at__extract_dayofyear + , subq_7.listing__created_at__extract_dow + , subq_7.listing__created_at__extract_doy , subq_7.metric_time__day , subq_7.metric_time__week , subq_7.metric_time__month @@ -410,8 +410,8 @@ CROSS JOIN ( , subq_7.metric_time__extract_month , subq_7.metric_time__extract_week , subq_7.metric_time__extract_day - , subq_7.metric_time__extract_dayofweek - , subq_7.metric_time__extract_dayofyear + , subq_7.metric_time__extract_dow + , subq_7.metric_time__extract_doy , subq_7.listing , subq_7.user , subq_7.listing__user @@ -437,8 +437,8 @@ CROSS JOIN ( , subq_6.ds__extract_month , subq_6.ds__extract_week , subq_6.ds__extract_day - , subq_6.ds__extract_dayofweek - , subq_6.ds__extract_dayofyear + , subq_6.ds__extract_dow + , subq_6.ds__extract_doy , subq_6.created_at__day , subq_6.created_at__week , subq_6.created_at__month @@ -449,8 +449,8 @@ CROSS JOIN ( , subq_6.created_at__extract_month , subq_6.created_at__extract_week , subq_6.created_at__extract_day - , subq_6.created_at__extract_dayofweek - , subq_6.created_at__extract_dayofyear + , subq_6.created_at__extract_dow + , subq_6.created_at__extract_doy , subq_6.listing__ds__day , subq_6.listing__ds__week , subq_6.listing__ds__month @@ -461,8 +461,8 @@ CROSS JOIN ( , subq_6.listing__ds__extract_month , subq_6.listing__ds__extract_week , subq_6.listing__ds__extract_day - , subq_6.listing__ds__extract_dayofweek - , subq_6.listing__ds__extract_dayofyear + , subq_6.listing__ds__extract_dow + , subq_6.listing__ds__extract_doy , subq_6.listing__created_at__day , subq_6.listing__created_at__week , subq_6.listing__created_at__month @@ -473,8 +473,8 @@ CROSS JOIN ( , subq_6.listing__created_at__extract_month , subq_6.listing__created_at__extract_week , subq_6.listing__created_at__extract_day - , subq_6.listing__created_at__extract_dayofweek - , subq_6.listing__created_at__extract_dayofyear + , subq_6.listing__created_at__extract_dow + , subq_6.listing__created_at__extract_doy , subq_6.ds__day AS metric_time__day , subq_6.ds__week AS metric_time__week , subq_6.ds__month AS metric_time__month @@ -485,8 +485,8 @@ CROSS JOIN ( , subq_6.ds__extract_month AS metric_time__extract_month , subq_6.ds__extract_week AS metric_time__extract_week , subq_6.ds__extract_day AS metric_time__extract_day - , subq_6.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_6.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_6.ds__extract_dow AS metric_time__extract_dow + , subq_6.ds__extract_doy AS metric_time__extract_doy , subq_6.listing , subq_6.user , subq_6.listing__user @@ -510,25 +510,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -537,25 +537,25 @@ CROSS JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql index 138d3b47ca..a716977aaf 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_nested_derived_metric__plan0.sql @@ -49,8 +49,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -61,8 +61,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -73,8 +73,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -85,8 +85,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -97,8 +97,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -109,8 +109,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -121,8 +121,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -167,74 +167,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -278,8 +278,8 @@ FROM ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -290,8 +290,8 @@ FROM ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -302,8 +302,8 @@ FROM ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -314,8 +314,8 @@ FROM ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -326,8 +326,8 @@ FROM ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -338,8 +338,8 @@ FROM ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.ds__day AS metric_time__day , subq_5.ds__week AS metric_time__week , subq_5.ds__month AS metric_time__month @@ -350,8 +350,8 @@ FROM ( , subq_5.ds__extract_month AS metric_time__extract_month , subq_5.ds__extract_week AS metric_time__extract_week , subq_5.ds__extract_day AS metric_time__extract_day - , subq_5.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -396,74 +396,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -519,8 +519,8 @@ FROM ( , subq_12.ds__extract_month , subq_12.ds__extract_week , subq_12.ds__extract_day - , subq_12.ds__extract_dayofweek - , subq_12.ds__extract_dayofyear + , subq_12.ds__extract_dow + , subq_12.ds__extract_doy , subq_12.ds_partitioned__day , subq_12.ds_partitioned__week , subq_12.ds_partitioned__month @@ -531,8 +531,8 @@ FROM ( , subq_12.ds_partitioned__extract_month , subq_12.ds_partitioned__extract_week , subq_12.ds_partitioned__extract_day - , subq_12.ds_partitioned__extract_dayofweek - , subq_12.ds_partitioned__extract_dayofyear + , subq_12.ds_partitioned__extract_dow + , subq_12.ds_partitioned__extract_doy , subq_12.paid_at__day , subq_12.paid_at__week , subq_12.paid_at__month @@ -543,8 +543,8 @@ FROM ( , subq_12.paid_at__extract_month , subq_12.paid_at__extract_week , subq_12.paid_at__extract_day - , subq_12.paid_at__extract_dayofweek - , subq_12.paid_at__extract_dayofyear + , subq_12.paid_at__extract_dow + , subq_12.paid_at__extract_doy , subq_12.booking__ds__day , subq_12.booking__ds__week , subq_12.booking__ds__month @@ -555,8 +555,8 @@ FROM ( , subq_12.booking__ds__extract_month , subq_12.booking__ds__extract_week , subq_12.booking__ds__extract_day - , subq_12.booking__ds__extract_dayofweek - , subq_12.booking__ds__extract_dayofyear + , subq_12.booking__ds__extract_dow + , subq_12.booking__ds__extract_doy , subq_12.booking__ds_partitioned__day , subq_12.booking__ds_partitioned__week , subq_12.booking__ds_partitioned__month @@ -567,8 +567,8 @@ FROM ( , subq_12.booking__ds_partitioned__extract_month , subq_12.booking__ds_partitioned__extract_week , subq_12.booking__ds_partitioned__extract_day - , subq_12.booking__ds_partitioned__extract_dayofweek - , subq_12.booking__ds_partitioned__extract_dayofyear + , subq_12.booking__ds_partitioned__extract_dow + , subq_12.booking__ds_partitioned__extract_doy , subq_12.booking__paid_at__day , subq_12.booking__paid_at__week , subq_12.booking__paid_at__month @@ -579,8 +579,8 @@ FROM ( , subq_12.booking__paid_at__extract_month , subq_12.booking__paid_at__extract_week , subq_12.booking__paid_at__extract_day - , subq_12.booking__paid_at__extract_dayofweek - , subq_12.booking__paid_at__extract_dayofyear + , subq_12.booking__paid_at__extract_dow + , subq_12.booking__paid_at__extract_doy , subq_12.ds__day AS metric_time__day , subq_12.ds__week AS metric_time__week , subq_12.ds__month AS metric_time__month @@ -591,8 +591,8 @@ FROM ( , subq_12.ds__extract_month AS metric_time__extract_month , subq_12.ds__extract_week AS metric_time__extract_week , subq_12.ds__extract_day AS metric_time__extract_day - , subq_12.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_12.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_12.ds__extract_dow AS metric_time__extract_dow + , subq_12.ds__extract_doy AS metric_time__extract_doy , subq_12.listing , subq_12.guest , subq_12.host @@ -637,74 +637,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -758,8 +758,8 @@ FROM ( , subq_17.ds__extract_month , subq_17.ds__extract_week , subq_17.ds__extract_day - , subq_17.ds__extract_dayofweek - , subq_17.ds__extract_dayofyear + , subq_17.ds__extract_dow + , subq_17.ds__extract_doy , subq_17.ds_partitioned__day , subq_17.ds_partitioned__week , subq_17.ds_partitioned__month @@ -770,8 +770,8 @@ FROM ( , subq_17.ds_partitioned__extract_month , subq_17.ds_partitioned__extract_week , subq_17.ds_partitioned__extract_day - , subq_17.ds_partitioned__extract_dayofweek - , subq_17.ds_partitioned__extract_dayofyear + , subq_17.ds_partitioned__extract_dow + , subq_17.ds_partitioned__extract_doy , subq_17.paid_at__day , subq_17.paid_at__week , subq_17.paid_at__month @@ -782,8 +782,8 @@ FROM ( , subq_17.paid_at__extract_month , subq_17.paid_at__extract_week , subq_17.paid_at__extract_day - , subq_17.paid_at__extract_dayofweek - , subq_17.paid_at__extract_dayofyear + , subq_17.paid_at__extract_dow + , subq_17.paid_at__extract_doy , subq_17.booking__ds__day , subq_17.booking__ds__week , subq_17.booking__ds__month @@ -794,8 +794,8 @@ FROM ( , subq_17.booking__ds__extract_month , subq_17.booking__ds__extract_week , subq_17.booking__ds__extract_day - , subq_17.booking__ds__extract_dayofweek - , subq_17.booking__ds__extract_dayofyear + , subq_17.booking__ds__extract_dow + , subq_17.booking__ds__extract_doy , subq_17.booking__ds_partitioned__day , subq_17.booking__ds_partitioned__week , subq_17.booking__ds_partitioned__month @@ -806,8 +806,8 @@ FROM ( , subq_17.booking__ds_partitioned__extract_month , subq_17.booking__ds_partitioned__extract_week , subq_17.booking__ds_partitioned__extract_day - , subq_17.booking__ds_partitioned__extract_dayofweek - , subq_17.booking__ds_partitioned__extract_dayofyear + , subq_17.booking__ds_partitioned__extract_dow + , subq_17.booking__ds_partitioned__extract_doy , subq_17.booking__paid_at__day , subq_17.booking__paid_at__week , subq_17.booking__paid_at__month @@ -818,8 +818,8 @@ FROM ( , subq_17.booking__paid_at__extract_month , subq_17.booking__paid_at__extract_week , subq_17.booking__paid_at__extract_day - , subq_17.booking__paid_at__extract_dayofweek - , subq_17.booking__paid_at__extract_dayofyear + , subq_17.booking__paid_at__extract_dow + , subq_17.booking__paid_at__extract_doy , subq_17.ds__day AS metric_time__day , subq_17.ds__week AS metric_time__week , subq_17.ds__month AS metric_time__month @@ -830,8 +830,8 @@ FROM ( , subq_17.ds__extract_month AS metric_time__extract_month , subq_17.ds__extract_week AS metric_time__extract_week , subq_17.ds__extract_day AS metric_time__extract_day - , subq_17.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_17.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_17.ds__extract_dow AS metric_time__extract_dow + , subq_17.ds__extract_doy AS metric_time__extract_doy , subq_17.listing , subq_17.guest , subq_17.host @@ -876,74 +876,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql index 63116a5458..d6632b499f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_order_by_node__plan0.sql @@ -45,74 +45,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql index e43e265eff..44cff4ab94 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_partitioned_join__plan0.sql @@ -41,8 +41,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -53,8 +53,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.verification__ds__day , subq_0.verification__ds__week , subq_0.verification__ds__month @@ -65,8 +65,8 @@ FROM ( , subq_0.verification__ds__extract_month , subq_0.verification__ds__extract_week , subq_0.verification__ds__extract_day - , subq_0.verification__ds__extract_dayofweek - , subq_0.verification__ds__extract_dayofyear + , subq_0.verification__ds__extract_dow + , subq_0.verification__ds__extract_doy , subq_0.verification__ds_partitioned__day , subq_0.verification__ds_partitioned__week , subq_0.verification__ds_partitioned__month @@ -77,8 +77,8 @@ FROM ( , subq_0.verification__ds_partitioned__extract_month , subq_0.verification__ds_partitioned__extract_week , subq_0.verification__ds_partitioned__extract_day - , subq_0.verification__ds_partitioned__extract_dayofweek - , subq_0.verification__ds_partitioned__extract_dayofyear + , subq_0.verification__ds_partitioned__extract_dow + , subq_0.verification__ds_partitioned__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -89,8 +89,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.verification , subq_0.user , subq_0.verification__user @@ -106,50 +106,50 @@ FROM ( , DATE_TRUNC('month', id_verifications_src_10003.ds) AS ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC('week', id_verifications_src_10003.ds) AS verification__ds__week , DATE_TRUNC('month', id_verifications_src_10003.ds) AS verification__ds__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds) AS verification__ds__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds) AS verification__ds__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC('week', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__week , DATE_TRUNC('month', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__month , DATE_TRUNC('quarter', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__quarter , DATE_TRUNC('year', id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__year - , EXTRACT(YEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(WEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week - , EXTRACT(DAY FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year + , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter + , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month + , EXTRACT(week FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day + , EXTRACT(dow FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(doy FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -173,74 +173,74 @@ FROM ( , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC('week', users_ds_source_src_10007.ds) AS user__ds__week , DATE_TRUNC('month', users_ds_source_src_10007.ds) AS user__ds__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds) AS user__ds__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds) AS user__ds__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC('week', users_ds_source_src_10007.created_at) AS user__created_at__week , DATE_TRUNC('month', users_ds_source_src_10007.created_at) AS user__created_at__month , DATE_TRUNC('quarter', users_ds_source_src_10007.created_at) AS user__created_at__quarter , DATE_TRUNC('year', users_ds_source_src_10007.created_at) AS user__created_at__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC('week', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__week , DATE_TRUNC('month', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__month , DATE_TRUNC('quarter', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__quarter , DATE_TRUNC('year', users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__year - , EXTRACT(YEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(WEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week - , EXTRACT(DAY FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year + , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter + , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month + , EXTRACT(week FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day + , EXTRACT(dow FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(doy FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql index d88d2d32f3..33fc914795 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -82,26 +82,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql index 094486f462..d90abbd294 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql index a8a26c9899..dc98b44d95 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index c400372dd4..d723157d2a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql index 30ab4c1851..95274f2863 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month AS ds__extract_month , subq_0.ds__extract_week AS ds__extract_week , subq_0.ds__extract_day AS ds__extract_day - , subq_0.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_0.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_0.ds__extract_dow AS ds__extract_dow + , subq_0.ds__extract_doy AS ds__extract_doy , subq_0.account__ds__day AS account__ds__day , subq_0.account__ds__week AS account__ds__week , subq_0.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_0.account__ds__extract_month AS account__ds__extract_month , subq_0.account__ds__extract_week AS account__ds__extract_week , subq_0.account__ds__extract_day AS account__ds__extract_day - , subq_0.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_0.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_0.account__ds__extract_dow AS account__ds__extract_dow + , subq_0.account__ds__extract_doy AS account__ds__extract_doy , subq_0.user AS user , subq_0.account__user AS account__user , subq_0.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -83,26 +83,26 @@ INNER JOIN ( , DATE_TRUNC('month', accounts_source_src_10000.ds) AS ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC('week', accounts_source_src_10000.ds) AS account__ds__week , DATE_TRUNC('month', accounts_source_src_10000.ds) AS account__ds__month , DATE_TRUNC('quarter', accounts_source_src_10000.ds) AS account__ds__quarter , DATE_TRUNC('year', accounts_source_src_10000.ds) AS account__ds__year - , EXTRACT(YEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week - , EXTRACT(DAY FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year + , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter + , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month + , EXTRACT(week FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day + , EXTRACT(dow FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(doy FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index ef337f422c..e0c877bdf1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -10,8 +10,8 @@ SELECT , subq_3.ds__extract_month AS ds__extract_month , subq_3.ds__extract_week AS ds__extract_week , subq_3.ds__extract_day AS ds__extract_day - , subq_3.ds__extract_dayofweek AS ds__extract_dayofweek - , subq_3.ds__extract_dayofyear AS ds__extract_dayofyear + , subq_3.ds__extract_dow AS ds__extract_dow + , subq_3.ds__extract_doy AS ds__extract_doy , subq_3.account__ds__day AS account__ds__day , subq_3.account__ds__week AS account__ds__week , subq_3.account__ds__month AS account__ds__month @@ -22,8 +22,8 @@ SELECT , subq_3.account__ds__extract_month AS account__ds__extract_month , subq_3.account__ds__extract_week AS account__ds__extract_week , subq_3.account__ds__extract_day AS account__ds__extract_day - , subq_3.account__ds__extract_dayofweek AS account__ds__extract_dayofweek - , subq_3.account__ds__extract_dayofyear AS account__ds__extract_dayofyear + , subq_3.account__ds__extract_dow AS account__ds__extract_dow + , subq_3.account__ds__extract_doy AS account__ds__extract_doy , subq_3.user AS user , subq_3.account__user AS account__user , subq_3.account_type AS account_type @@ -42,26 +42,26 @@ FROM ( , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC('week', ds) AS account__ds__week , DATE_TRUNC('month', ds) AS account__ds__month , DATE_TRUNC('quarter', ds) AS account__ds__quarter , DATE_TRUNC('year', ds) AS account__ds__year - , EXTRACT(YEAR FROM ds) AS account__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS account__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS account__ds__extract_month - , EXTRACT(WEEK FROM ds) AS account__ds__extract_week - , EXTRACT(DAY FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS account__ds__extract_year + , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter + , EXTRACT(month FROM ds) AS account__ds__extract_month + , EXTRACT(week FROM ds) AS account__ds__extract_week + , EXTRACT(day FROM ds) AS account__ds__extract_day + , EXTRACT(dow FROM ds) AS account__ds__extract_dow + , EXTRACT(doy FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql index 16b897731d..9c6e0a2676 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_single_join_node__plan0.sql @@ -31,74 +31,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -125,25 +125,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -152,25 +152,25 @@ LEFT OUTER JOIN ( , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__ds__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__ds__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__ds__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC('week', listings_latest_src_10004.created_at) AS listing__created_at__week , DATE_TRUNC('month', listings_latest_src_10004.created_at) AS listing__created_at__month , DATE_TRUNC('quarter', listings_latest_src_10004.created_at) AS listing__created_at__quarter , DATE_TRUNC('year', listings_latest_src_10004.created_at) AS listing__created_at__year - , EXTRACT(YEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year - , EXTRACT(QUARTER FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter - , EXTRACT(MONTH FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(WEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week - , EXTRACT(DAY FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dayofyear + , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year + , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter + , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month + , EXTRACT(week FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day + , EXTRACT(dow FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(doy FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql index 7dd5c3b39d..b9ae7f84a4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql index e240956212..d1560d9ab0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_source_node__plan0_optimized.sql @@ -20,74 +20,74 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 6eb1db1ad8..66b9a92b39 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.paid_at__extract_month AS metric_time__extract_month , subq_0.paid_at__extract_week AS metric_time__extract_week , subq_0.paid_at__extract_day AS metric_time__extract_day - , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.paid_at__extract_dow AS metric_time__extract_dow + , subq_0.paid_at__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -116,74 +116,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 25222a0a63..cfaecd587b 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month , DATE_TRUNC(paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month , DATE_TRUNC(ds, quarter) AS booking__ds__quarter , DATE_TRUNC(ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month , DATE_TRUNC(paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC(paid_at, isoweek) AS metric_time__week , DATE_TRUNC(paid_at, month) AS metric_time__month , DATE_TRUNC(paid_at, quarter) AS metric_time__quarter , DATE_TRUNC(paid_at, year) AS metric_time__year - , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year - , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month - , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week - , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear + , EXTRACT(year FROM paid_at) AS metric_time__extract_year + , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(month FROM paid_at) AS metric_time__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(day FROM paid_at) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 07a5a8e779..9895b04f88 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -128,74 +128,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 49d41bb5d7..9e14d2f83b 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC(ds, month) AS ds__month , DATE_TRUNC(ds, quarter) AS ds__quarter , DATE_TRUNC(ds, year) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month , DATE_TRUNC(paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month , DATE_TRUNC(ds, quarter) AS booking__ds__quarter , DATE_TRUNC(ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month , DATE_TRUNC(paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC(ds, isoweek) AS metric_time__week , DATE_TRUNC(ds, month) AS metric_time__month , DATE_TRUNC(ds, quarter) AS metric_time__quarter , DATE_TRUNC(ds, year) AS metric_time__year - , EXTRACT(YEAR FROM ds) AS metric_time__extract_year - , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM ds) AS metric_time__extract_month - , EXTRACT(WEEK FROM ds) AS metric_time__extract_week - , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear + , EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(ISOWEEK FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dow + , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql index 7b4716534b..599746d204 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month AS metric_time__extract_month , subq_5.paid_at__extract_week AS metric_time__extract_week , subq_5.paid_at__extract_day AS metric_time__extract_day - , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.paid_at__extract_dow AS metric_time__extract_dow + , subq_5.paid_at__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -367,74 +367,74 @@ FULL OUTER JOIN ( , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 5bbf8cbab3..e9ab8e5153 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.paid_at__extract_month AS metric_time__extract_month , subq_0.paid_at__extract_week AS metric_time__extract_week , subq_0.paid_at__extract_day AS metric_time__extract_day - , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.paid_at__extract_dow AS metric_time__extract_dow + , subq_0.paid_at__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -116,74 +116,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/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/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 746c7caf59..00e036ec03 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/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/Databricks/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year - , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year - , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month - , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week - , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS metric_time__extract_dayofyear + , EXTRACT(year FROM paid_at) AS metric_time__extract_year + , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(month FROM paid_at) AS metric_time__extract_month + , EXTRACT(week FROM paid_at) AS metric_time__extract_week + , EXTRACT(day FROM paid_at) AS metric_time__extract_day + , EXTRACT(dow FROM paid_at) AS metric_time__extract_dow + , EXTRACT(doy FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index bb677b5714..e2cc747ae2 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -128,74 +128,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index d67732107d..c6d742fae0 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year - , EXTRACT(YEAR FROM ds) AS metric_time__extract_year - , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM ds) AS metric_time__extract_month - , EXTRACT(WEEK FROM ds) AS metric_time__extract_week - , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek - , EXTRACT(DOY FROM ds) AS metric_time__extract_dayofyear + , EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql index a7e28bf336..c88105f92d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Databricks/test_simple_query_with_metric_time_dimension__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month AS metric_time__extract_month , subq_5.paid_at__extract_week AS metric_time__extract_week , subq_5.paid_at__extract_day AS metric_time__extract_day - , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.paid_at__extract_dow AS metric_time__extract_dow + , subq_5.paid_at__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -367,74 +367,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DOY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index c1a2ea132e..e9ab8e5153 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -116,74 +116,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 5b9d645f22..00e036ec03 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/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/DuckDB/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year - , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year - , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month - , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week - , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_doy + , EXTRACT(year FROM paid_at) AS metric_time__extract_year + , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(month FROM paid_at) AS metric_time__extract_month + , EXTRACT(week FROM paid_at) AS metric_time__extract_week + , EXTRACT(day FROM paid_at) AS metric_time__extract_day + , EXTRACT(dow FROM paid_at) AS metric_time__extract_dow + , EXTRACT(doy FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index e5d56619ca..e2cc747ae2 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -128,74 +128,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 72985c569e..c6d742fae0 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year - , EXTRACT(YEAR FROM ds) AS metric_time__extract_year - , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM ds) AS metric_time__extract_month - , EXTRACT(WEEK FROM ds) AS metric_time__extract_week - , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_doy + , EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql index 08c1707601..c88105f92d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/DuckDB/test_simple_query_with_metric_time_dimension__plan0.sql @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -367,74 +367,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index b9c1d34bad..e9ab8e5153 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.paid_at__extract_month AS metric_time__extract_month , subq_0.paid_at__extract_week AS metric_time__extract_week , subq_0.paid_at__extract_day AS metric_time__extract_day - , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.paid_at__extract_dow AS metric_time__extract_dow + , subq_0.paid_at__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -116,74 +116,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/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/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 9326cd820a..00e036ec03 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/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/Postgres/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year - , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year - , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month - , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week - , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear + , EXTRACT(year FROM paid_at) AS metric_time__extract_year + , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(month FROM paid_at) AS metric_time__extract_month + , EXTRACT(week FROM paid_at) AS metric_time__extract_week + , EXTRACT(day FROM paid_at) AS metric_time__extract_day + , EXTRACT(dow FROM paid_at) AS metric_time__extract_dow + , EXTRACT(doy FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index a2a9795f0c..e2cc747ae2 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -128,74 +128,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 30a42573dd..c6d742fae0 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year - , EXTRACT(YEAR FROM ds) AS metric_time__extract_year - , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM ds) AS metric_time__extract_month - , EXTRACT(WEEK FROM ds) AS metric_time__extract_week - , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear + , EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql index 4b399298d5..c88105f92d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Postgres/test_simple_query_with_metric_time_dimension__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month AS metric_time__extract_month , subq_5.paid_at__extract_week AS metric_time__extract_week , subq_5.paid_at__extract_day AS metric_time__extract_day - , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.paid_at__extract_dow AS metric_time__extract_dow + , subq_5.paid_at__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -367,74 +367,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index b9c1d34bad..e9ab8e5153 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.paid_at__extract_month AS metric_time__extract_month , subq_0.paid_at__extract_week AS metric_time__extract_week , subq_0.paid_at__extract_day AS metric_time__extract_day - , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.paid_at__extract_dow AS metric_time__extract_dow + , subq_0.paid_at__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -116,74 +116,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/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/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 9326cd820a..00e036ec03 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/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/Redshift/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year - , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year - , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month - , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week - , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear + , EXTRACT(year FROM paid_at) AS metric_time__extract_year + , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(month FROM paid_at) AS metric_time__extract_month + , EXTRACT(week FROM paid_at) AS metric_time__extract_week + , EXTRACT(day FROM paid_at) AS metric_time__extract_day + , EXTRACT(dow FROM paid_at) AS metric_time__extract_dow + , EXTRACT(doy FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index a2a9795f0c..e2cc747ae2 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -128,74 +128,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 30a42573dd..c6d742fae0 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year - , EXTRACT(YEAR FROM ds) AS metric_time__extract_year - , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM ds) AS metric_time__extract_month - , EXTRACT(WEEK FROM ds) AS metric_time__extract_week - , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear + , EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql index 4b399298d5..c88105f92d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Redshift/test_simple_query_with_metric_time_dimension__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month AS metric_time__extract_month , subq_5.paid_at__extract_week AS metric_time__extract_week , subq_5.paid_at__extract_day AS metric_time__extract_day - , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.paid_at__extract_dow AS metric_time__extract_dow + , subq_5.paid_at__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -367,74 +367,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index b9c1d34bad..e9ab8e5153 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.paid_at__day AS metric_time__day , subq_0.paid_at__week AS metric_time__week , subq_0.paid_at__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.paid_at__extract_month AS metric_time__extract_month , subq_0.paid_at__extract_week AS metric_time__extract_week , subq_0.paid_at__extract_day AS metric_time__extract_day - , subq_0.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.paid_at__extract_dow AS metric_time__extract_dow + , subq_0.paid_at__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -116,74 +116,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/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/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index 9326cd820a..00e036ec03 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/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/Snowflake/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC('week', paid_at) AS metric_time__week , DATE_TRUNC('month', paid_at) AS metric_time__month , DATE_TRUNC('quarter', paid_at) AS metric_time__quarter , DATE_TRUNC('year', paid_at) AS metric_time__year - , EXTRACT(YEAR FROM paid_at) AS metric_time__extract_year - , EXTRACT(QUARTER FROM paid_at) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS metric_time__extract_month - , EXTRACT(WEEK FROM paid_at) AS metric_time__extract_week - , EXTRACT(DAY FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_dayofyear + , EXTRACT(year FROM paid_at) AS metric_time__extract_year + , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter + , EXTRACT(month FROM paid_at) AS metric_time__extract_month + , EXTRACT(week FROM paid_at) AS metric_time__extract_week + , EXTRACT(day FROM paid_at) AS metric_time__extract_day + , EXTRACT(dow FROM paid_at) AS metric_time__extract_dow + , EXTRACT(doy FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index a2a9795f0c..e2cc747ae2 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -10,8 +10,8 @@ SELECT , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -22,8 +22,8 @@ SELECT , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -34,8 +34,8 @@ SELECT , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -46,8 +46,8 @@ SELECT , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -58,8 +58,8 @@ SELECT , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -70,8 +70,8 @@ SELECT , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -82,8 +82,8 @@ SELECT , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -128,74 +128,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 30a42573dd..c6d742fae0 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -6,85 +6,85 @@ SELECT , DATE_TRUNC('month', ds) AS ds__month , DATE_TRUNC('quarter', ds) AS ds__quarter , DATE_TRUNC('year', ds) AS ds__year - , EXTRACT(YEAR FROM ds) AS ds__extract_year - , EXTRACT(QUARTER FROM ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS ds__extract_month - , EXTRACT(WEEK FROM ds) AS ds__extract_week - , EXTRACT(DAY FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_dayofyear + , EXTRACT(year FROM ds) AS ds__extract_year + , EXTRACT(quarter FROM ds) AS ds__extract_quarter + , EXTRACT(month FROM ds) AS ds__extract_month + , EXTRACT(week FROM ds) AS ds__extract_week + , EXTRACT(day FROM ds) AS ds__extract_day + , EXTRACT(dow FROM ds) AS ds__extract_dow + , EXTRACT(doy FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC('week', paid_at) AS paid_at__week , DATE_TRUNC('month', paid_at) AS paid_at__month , DATE_TRUNC('quarter', paid_at) AS paid_at__quarter , DATE_TRUNC('year', paid_at) AS paid_at__year - , EXTRACT(YEAR FROM paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS paid_at__extract_month + , EXTRACT(week FROM paid_at) AS paid_at__extract_week + , EXTRACT(day FROM paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC('week', ds) AS booking__ds__week , DATE_TRUNC('month', ds) AS booking__ds__month , DATE_TRUNC('quarter', ds) AS booking__ds__quarter , DATE_TRUNC('year', ds) AS booking__ds__year - , EXTRACT(YEAR FROM ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM ds) AS booking__ds__extract_month + , EXTRACT(week FROM ds) AS booking__ds__extract_week + , EXTRACT(day FROM ds) AS booking__ds__extract_day + , EXTRACT(dow FROM ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC('week', paid_at) AS booking__paid_at__week , DATE_TRUNC('month', paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC('week', ds) AS metric_time__week , DATE_TRUNC('month', ds) AS metric_time__month , DATE_TRUNC('quarter', ds) AS metric_time__quarter , DATE_TRUNC('year', ds) AS metric_time__year - , EXTRACT(YEAR FROM ds) AS metric_time__extract_year - , EXTRACT(QUARTER FROM ds) AS metric_time__extract_quarter - , EXTRACT(MONTH FROM ds) AS metric_time__extract_month - , EXTRACT(WEEK FROM ds) AS metric_time__extract_week - , EXTRACT(DAY FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_dayofyear + , EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql index 4b399298d5..c88105f92d 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/Snowflake/test_simple_query_with_metric_time_dimension__plan0.sql @@ -32,8 +32,8 @@ FROM ( , subq_0.ds__extract_month , subq_0.ds__extract_week , subq_0.ds__extract_day - , subq_0.ds__extract_dayofweek - , subq_0.ds__extract_dayofyear + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy , subq_0.ds_partitioned__day , subq_0.ds_partitioned__week , subq_0.ds_partitioned__month @@ -44,8 +44,8 @@ FROM ( , subq_0.ds_partitioned__extract_month , subq_0.ds_partitioned__extract_week , subq_0.ds_partitioned__extract_day - , subq_0.ds_partitioned__extract_dayofweek - , subq_0.ds_partitioned__extract_dayofyear + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy , subq_0.paid_at__day , subq_0.paid_at__week , subq_0.paid_at__month @@ -56,8 +56,8 @@ FROM ( , subq_0.paid_at__extract_month , subq_0.paid_at__extract_week , subq_0.paid_at__extract_day - , subq_0.paid_at__extract_dayofweek - , subq_0.paid_at__extract_dayofyear + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy , subq_0.booking__ds__day , subq_0.booking__ds__week , subq_0.booking__ds__month @@ -68,8 +68,8 @@ FROM ( , subq_0.booking__ds__extract_month , subq_0.booking__ds__extract_week , subq_0.booking__ds__extract_day - , subq_0.booking__ds__extract_dayofweek - , subq_0.booking__ds__extract_dayofyear + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy , subq_0.booking__ds_partitioned__day , subq_0.booking__ds_partitioned__week , subq_0.booking__ds_partitioned__month @@ -80,8 +80,8 @@ FROM ( , subq_0.booking__ds_partitioned__extract_month , subq_0.booking__ds_partitioned__extract_week , subq_0.booking__ds_partitioned__extract_day - , subq_0.booking__ds_partitioned__extract_dayofweek - , subq_0.booking__ds_partitioned__extract_dayofyear + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy , subq_0.booking__paid_at__day , subq_0.booking__paid_at__week , subq_0.booking__paid_at__month @@ -92,8 +92,8 @@ FROM ( , subq_0.booking__paid_at__extract_month , subq_0.booking__paid_at__extract_week , subq_0.booking__paid_at__extract_day - , subq_0.booking__paid_at__extract_dayofweek - , subq_0.booking__paid_at__extract_dayofyear + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy , subq_0.ds__day AS metric_time__day , subq_0.ds__week AS metric_time__week , subq_0.ds__month AS metric_time__month @@ -104,8 +104,8 @@ FROM ( , subq_0.ds__extract_month AS metric_time__extract_month , subq_0.ds__extract_week AS metric_time__extract_week , subq_0.ds__extract_day AS metric_time__extract_day - , subq_0.ds__extract_dayofweek AS metric_time__extract_dayofweek - , subq_0.ds__extract_dayofyear AS metric_time__extract_dayofyear + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy , subq_0.listing , subq_0.guest , subq_0.host @@ -150,74 +150,74 @@ FROM ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -261,8 +261,8 @@ FULL OUTER JOIN ( , subq_5.ds__extract_month , subq_5.ds__extract_week , subq_5.ds__extract_day - , subq_5.ds__extract_dayofweek - , subq_5.ds__extract_dayofyear + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy , subq_5.ds_partitioned__day , subq_5.ds_partitioned__week , subq_5.ds_partitioned__month @@ -273,8 +273,8 @@ FULL OUTER JOIN ( , subq_5.ds_partitioned__extract_month , subq_5.ds_partitioned__extract_week , subq_5.ds_partitioned__extract_day - , subq_5.ds_partitioned__extract_dayofweek - , subq_5.ds_partitioned__extract_dayofyear + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy , subq_5.paid_at__day , subq_5.paid_at__week , subq_5.paid_at__month @@ -285,8 +285,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month , subq_5.paid_at__extract_week , subq_5.paid_at__extract_day - , subq_5.paid_at__extract_dayofweek - , subq_5.paid_at__extract_dayofyear + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy , subq_5.booking__ds__day , subq_5.booking__ds__week , subq_5.booking__ds__month @@ -297,8 +297,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds__extract_month , subq_5.booking__ds__extract_week , subq_5.booking__ds__extract_day - , subq_5.booking__ds__extract_dayofweek - , subq_5.booking__ds__extract_dayofyear + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy , subq_5.booking__ds_partitioned__day , subq_5.booking__ds_partitioned__week , subq_5.booking__ds_partitioned__month @@ -309,8 +309,8 @@ FULL OUTER JOIN ( , subq_5.booking__ds_partitioned__extract_month , subq_5.booking__ds_partitioned__extract_week , subq_5.booking__ds_partitioned__extract_day - , subq_5.booking__ds_partitioned__extract_dayofweek - , subq_5.booking__ds_partitioned__extract_dayofyear + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy , subq_5.booking__paid_at__day , subq_5.booking__paid_at__week , subq_5.booking__paid_at__month @@ -321,8 +321,8 @@ FULL OUTER JOIN ( , subq_5.booking__paid_at__extract_month , subq_5.booking__paid_at__extract_week , subq_5.booking__paid_at__extract_day - , subq_5.booking__paid_at__extract_dayofweek - , subq_5.booking__paid_at__extract_dayofyear + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy , subq_5.paid_at__day AS metric_time__day , subq_5.paid_at__week AS metric_time__week , subq_5.paid_at__month AS metric_time__month @@ -333,8 +333,8 @@ FULL OUTER JOIN ( , subq_5.paid_at__extract_month AS metric_time__extract_month , subq_5.paid_at__extract_week AS metric_time__extract_week , subq_5.paid_at__extract_day AS metric_time__extract_day - , subq_5.paid_at__extract_dayofweek AS metric_time__extract_dayofweek - , subq_5.paid_at__extract_dayofyear AS metric_time__extract_dayofyear + , subq_5.paid_at__extract_dow AS metric_time__extract_dow + , subq_5.paid_at__extract_doy AS metric_time__extract_doy , subq_5.listing , subq_5.guest , subq_5.host @@ -367,74 +367,74 @@ FULL OUTER JOIN ( , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year - , EXTRACT(YEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year - , EXTRACT(YEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year - , EXTRACT(QUARTER FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter - , EXTRACT(MONTH FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(WEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week - , EXTRACT(DAY FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofweek - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dayofyear + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/sql/test_sql_expr_render.py b/metricflow/test/sql/test_sql_expr_render.py index 035dca2f2e..5d3e309b36 100644 --- a/metricflow/test/sql/test_sql_expr_render.py +++ b/metricflow/test/sql/test_sql_expr_render.py @@ -197,9 +197,9 @@ def test_date_trunc_expr(default_expr_renderer: DefaultSqlExpressionRenderer) -> def test_extract_expr(default_expr_renderer: DefaultSqlExpressionRenderer) -> None: # noqa: D actual = default_expr_renderer.render_sql_expr( - SqlExtractExpression(date_part=DatePart.DAYOFYEAR, arg=SqlStringExpression("ds")) + SqlExtractExpression(date_part=DatePart.DOY, arg=SqlStringExpression("ds")) ).sql - assert actual == "EXTRACT(DAYOFYEAR FROM ds)" + assert actual == "EXTRACT(doy FROM ds)" def test_ratio_computation_expr(default_expr_renderer: DefaultSqlExpressionRenderer) -> None: # noqa: D diff --git a/metricflow/time/date_part.py b/metricflow/time/date_part.py index cccb1be6c8..4dad63d644 100644 --- a/metricflow/time/date_part.py +++ b/metricflow/time/date_part.py @@ -17,16 +17,16 @@ class DatePart(Enum): MONTH = "month" WEEK = "week" DAY = "day" - DAYOFWEEK = "dow" - DAYOFYEAR = "doy" + DOW = "dow" + DOY = "doy" def to_int(self) -> int: """Convert to an int so that the size of the granularity can be easily compared.""" if self is DatePart.DAY: return TimeGranularity.DAY.to_int() - elif self is DatePart.DAYOFWEEK: + elif self is DatePart.DOW: return TimeGranularity.DAY.to_int() - elif self is DatePart.DAYOFYEAR: + elif self is DatePart.DOY: return TimeGranularity.DAY.to_int() elif self is DatePart.WEEK: return TimeGranularity.WEEK.to_int() From 254093ebbdb861f5d704b5aa92efcb2480b0b225 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 12 Sep 2023 13:46:19 -0700 Subject: [PATCH 09/15] Undo snapshot script edit --- metricflow/test/generate_snapshots.py | 40 +++++++++++++-------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/metricflow/test/generate_snapshots.py b/metricflow/test/generate_snapshots.py index 9acafe9573..64b87d91b5 100644 --- a/metricflow/test/generate_snapshots.py +++ b/metricflow/test/generate_snapshots.py @@ -70,30 +70,30 @@ class MetricFlowTestCredentialSetForAllEngines(FrozenBaseModel): # noqa: D @property def as_configurations(self) -> Sequence[MetricFlowTestConfiguration]: # noqa: D return ( - # MetricFlowTestConfiguration( - # engine=SqlEngine.DUCKDB, - # credential_set=self.duck_db, - # ), - # MetricFlowTestConfiguration( - # engine=SqlEngine.REDSHIFT, - # credential_set=self.redshift, - # ), - # MetricFlowTestConfiguration( - # engine=SqlEngine.SNOWFLAKE, - # credential_set=self.snowflake, - # ), + MetricFlowTestConfiguration( + engine=SqlEngine.DUCKDB, + credential_set=self.duck_db, + ), + MetricFlowTestConfiguration( + engine=SqlEngine.REDSHIFT, + credential_set=self.redshift, + ), + MetricFlowTestConfiguration( + engine=SqlEngine.SNOWFLAKE, + credential_set=self.snowflake, + ), MetricFlowTestConfiguration( engine=SqlEngine.BIGQUERY, credential_set=self.big_query, ), - # MetricFlowTestConfiguration( - # engine=SqlEngine.DATABRICKS, - # credential_set=self.databricks, - # ), - # MetricFlowTestConfiguration( - # engine=SqlEngine.POSTGRES, - # credential_set=self.postgres, - # ), + MetricFlowTestConfiguration( + engine=SqlEngine.DATABRICKS, + credential_set=self.databricks, + ), + MetricFlowTestConfiguration( + engine=SqlEngine.POSTGRES, + credential_set=self.postgres, + ), ) From 85252b0d81b1437102226aba0c719023f5393f8b Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 12 Sep 2023 17:44:47 -0700 Subject: [PATCH 10/15] Handle group by object parameter --- .../dataflow/builder/dataflow_plan_builder.py | 2 +- metricflow/engine/metricflow_engine.py | 1 + metricflow/naming/linkable_spec_name.py | 26 ------- metricflow/query/query_parser.py | 76 +++++++++++++++---- metricflow/test/conftest.py | 15 ++++ .../test/integration/configured_test_case.py | 3 +- .../integration/test_cases/itest_metrics.yaml | 12 ++- .../test/integration/test_configured_cases.py | 10 +++ metricflow/test/query/test_query_parser.py | 46 +++++++---- .../test/time/test_time_granularity_solver.py | 16 ++-- metricflow/time/time_granularity_solver.py | 31 +++++--- 11 files changed, 159 insertions(+), 79 deletions(-) diff --git a/metricflow/dataflow/builder/dataflow_plan_builder.py b/metricflow/dataflow/builder/dataflow_plan_builder.py index 1445c7918f..c989d43131 100644 --- a/metricflow/dataflow/builder/dataflow_plan_builder.py +++ b/metricflow/dataflow/builder/dataflow_plan_builder.py @@ -792,7 +792,7 @@ def _build_aggregated_measures_from_measure_source_node( # If querying an offset metric, join to time spine. join_to_time_spine_node: Optional[JoinToTimeSpineNode] = None if metric_spec.offset_window or metric_spec.offset_to_grain: - assert metric_time_dimension_specs, "Joining to time spine requires querying with metric time." + assert metric_time_dimension_specs, "Joining to time spine requires querying with metric_time." join_to_time_spine_node = JoinToTimeSpineNode( parent_node=time_range_node or measure_recipe.measure_node, metric_time_dimension_specs=metric_time_dimension_specs, diff --git a/metricflow/engine/metricflow_engine.py b/metricflow/engine/metricflow_engine.py index d08163c5d4..e508c32a92 100644 --- a/metricflow/engine/metricflow_engine.py +++ b/metricflow/engine/metricflow_engine.py @@ -456,6 +456,7 @@ def _create_execution_plan(self, mf_query_request: MetricFlowQueryRequest) -> Me query_spec = self._query_parser.parse_and_validate_query( metric_names=mf_query_request.metric_names, group_by_names=mf_query_request.group_by_names, + group_by=mf_query_request.group_by, limit=mf_query_request.limit, time_constraint_start=mf_query_request.time_constraint_start, time_constraint_end=mf_query_request.time_constraint_end, diff --git a/metricflow/naming/linkable_spec_name.py b/metricflow/naming/linkable_spec_name.py index 01c3863ad0..0e73415cd4 100644 --- a/metricflow/naming/linkable_spec_name.py +++ b/metricflow/naming/linkable_spec_name.py @@ -37,31 +37,6 @@ def from_name(qualified_name: str) -> StructuredLinkableSpecName: if len(name_parts) == 1: return StructuredLinkableSpecName(entity_link_names=(), element_name=name_parts[0]) - associated_date_part: Optional[DatePart] = None - for date_part in DatePart: - if name_parts[-1] == StructuredLinkableSpecName.date_part_suffix(date_part): - associated_date_part = date_part - - # Has a date_part - if associated_date_part: - # e.g. "ds__extract_month" - if len(name_parts) == 2: - # Since DAY works with all currently supported DateParts & changing the granularity will not change the - # extracted date part, assume day granularity here. - time_granularity = TimeGranularity.DAY - return StructuredLinkableSpecName( - entity_link_names=(), - element_name=name_parts[0], - time_granularity=time_granularity, - date_part=associated_date_part, - ) - # e.g. "messages__ds__extract_month" - return StructuredLinkableSpecName( - entity_link_names=tuple(name_parts[:-2]), - element_name=name_parts[-2], - date_part=associated_date_part, - ) - associated_granularity = None granularity: TimeGranularity for granularity in TimeGranularity: @@ -94,7 +69,6 @@ def qualified_name(self) -> str: items.append(self.date_part_suffix(date_part=self.date_part)) elif self.time_granularity: items.append(self.time_granularity.value) - return DUNDER.join(items) @property diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 956f3933fc..329bb3bdc3 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -299,7 +299,12 @@ def _get_group_by_names( return ( group_by_names if group_by_names - else [f"{g.name}__{g.date_part or g.grain}" if (g.date_part or g.grain) else g.name for g in group_by] + else [ + StructuredLinkableSpecName( + entity_link_names=(), element_name=g.name, time_granularity=g.grain, date_part=g.date_part + ).qualified_name + for g in group_by + ] if group_by else [] ) @@ -344,7 +349,6 @@ def _parse_and_validate_query( time_granularity: Optional[TimeGranularity] = None, ) -> MetricFlowQuerySpec: metric_names = self._get_metric_names(metric_names, metrics) - group_by_names = self._get_group_by_names(group_by_names, group_by) where_filter = self._get_where_filter(where_constraint, where_constraint_str) order = self._get_order(order, order_by) @@ -394,7 +398,9 @@ def _parse_and_validate_query( # If the time constraint is all time, just ignore and not render time_constraint = None - requested_linkable_specs = self._parse_linkable_element_names(group_by_names, metric_references) + requested_linkable_specs = self._parse_linkable_elements( + qualified_linkable_names=group_by_names, linkable_elements=group_by, metric_references=metric_references + ) where_filter_spec: Optional[WhereFilterSpec] = None if where_filter is not None: try: @@ -427,7 +433,16 @@ def _parse_and_validate_query( if len(time_dimension_specs) == 0: self._validate_no_time_dimension_query(metric_references=metric_references) - self._time_granularity_solver.validate_time_granularity(metric_references, time_dimension_specs) + self._time_granularity_solver.validate_time_granularity_and_date_part(metric_references, time_dimension_specs) + for time_dimension_spec in time_dimension_specs: + if ( + time_dimension_spec.date_part + and time_dimension_spec.date_part.to_int() < time_dimension_spec.time_granularity.to_int() + ): + raise RequestTimeGranularityException( + f"Date part {time_dimension_spec.date_part.name} is not compatible with time granularity " + f"{time_dimension_spec.time_granularity.name}." + ) order_by_specs = self._parse_order_by(order or [], partial_time_dimension_spec_replacements) @@ -437,8 +452,9 @@ def _parse_and_validate_query( for metric_reference in metric_references: metric = self._metric_lookup.get_metric(metric_reference) if metric.filter is not None: - group_by_specs_for_one_metric = self._parse_linkable_element_names( + group_by_specs_for_one_metric = self._parse_linkable_elements( qualified_linkable_names=group_by_names, + linkable_elements=group_by, metric_references=(metric_reference,), ) @@ -492,7 +508,7 @@ def _parse_and_validate_query( raise InvalidQueryException(f"Limit was specified as {limit}, which is < 0.") if where_filter_spec: - self._time_granularity_solver.validate_time_granularity( + self._time_granularity_solver.validate_time_granularity_and_date_part( metric_references=metric_references, time_dimension_specs=where_filter_spec.linkable_spec_set.time_dimension_specs, ) @@ -537,7 +553,7 @@ def _adjust_time_range_constraint( time_range_constraint: TimeRangeConstraint, ) -> TimeRangeConstraint: """Adjust the time range constraint so that it matches the boundaries of the granularity of the result.""" - self._time_granularity_solver.validate_time_granularity(metric_references, time_dimension_specs) + self._time_granularity_solver.validate_time_granularity_and_date_part(metric_references, time_dimension_specs) smallest_primary_time_granularity_in_query = self._find_smallest_metric_time_dimension_spec_granularity( time_dimension_specs @@ -644,21 +660,38 @@ def _parse_metric_names( metric_references.extend(list(input_metrics)) return tuple(metric_references) - def _parse_linkable_element_names( + def _parse_linkable_elements( self, - qualified_linkable_names: Sequence[str], metric_references: Sequence[MetricReference], + qualified_linkable_names: Optional[Sequence[str]] = None, + linkable_elements: Optional[Sequence[QueryParameter]] = None, ) -> QueryTimeLinkableSpecSet: """Convert the linkable spec names into the respective specification objects.""" - qualified_linkable_names = [x.lower() for x in qualified_linkable_names] + assert not (qualified_linkable_names and linkable_elements) + + structured_names: List[StructuredLinkableSpecName] = [] + if qualified_linkable_names: + qualified_linkable_names = [x.lower() for x in qualified_linkable_names] + structured_names = [StructuredLinkableSpecName.from_name(name) for name in qualified_linkable_names] + elif linkable_elements: + for linkable_element in linkable_elements: + parsed_name = StructuredLinkableSpecName.from_name(linkable_element.name) + if parsed_name.time_granularity: + raise ValueError("Time granularity must be passed in the grain attribute for group_by query param.") + structured_name = StructuredLinkableSpecName( + entity_link_names=parsed_name.entity_link_names, + element_name=parsed_name.element_name, + time_granularity=linkable_element.grain, + date_part=linkable_element.date_part, + ) + structured_names.append(structured_name) dimension_specs = [] time_dimension_specs = [] partial_time_dimension_specs = [] entity_specs = [] - for qualified_name in qualified_linkable_names: - structured_name = StructuredLinkableSpecName.from_name(qualified_name) + for structured_name in structured_names: element_name = structured_name.element_name entity_links = tuple(EntityReference(element_name=x) for x in structured_name.entity_link_names) # Create the spec based on the type of element referenced. @@ -677,6 +710,7 @@ def _parse_linkable_element_names( PartialTimeDimensionSpec( element_name=element_name, entity_links=entity_links, + date_part=structured_name.date_part, ) ) elif DimensionReference(element_name=element_name) in self._known_dimension_element_references: @@ -684,20 +718,30 @@ def _parse_linkable_element_names( elif EntityReference(element_name=element_name) in self._known_entity_element_references: entity_specs.append(EntitySpec(element_name=element_name, entity_links=entity_links)) else: + valid_group_bys_for_metrics = self._metric_lookup.element_specs_for_metrics(list(metric_references)) valid_group_by_names_for_metrics = sorted( - x.qualified_name for x in self._metric_lookup.element_specs_for_metrics(list(metric_references)) + list( + set( + x.qualified_name if qualified_linkable_names else x.element_name + for x in valid_group_bys_for_metrics + ) + ) ) + # If requested by name, show qualified name. If requested as object, show element name. + display_name = structured_name.qualified_name if qualified_linkable_names else element_name suggestions = { - f"Suggestions for '{qualified_name}'": pformat_big_objects( + f"Suggestions for '{display_name}'": pformat_big_objects( MetricFlowQueryParser._top_fuzzy_matches( - item=qualified_name, + item=display_name, candidate_items=valid_group_by_names_for_metrics, ) ) } raise UnableToSatisfyQueryError( - f"Unknown element name '{element_name}' in dimension name '{qualified_name}'", + f"Unknown element name '{element_name}' in dimension name '{display_name}'" + if qualified_linkable_names + else f"Unknown dimension {element_name}", context=suggestions, ) diff --git a/metricflow/test/conftest.py b/metricflow/test/conftest.py index 31cb6d558e..13318c9f16 100644 --- a/metricflow/test/conftest.py +++ b/metricflow/test/conftest.py @@ -1,6 +1,11 @@ # These imports are required to properly set up pytest fixtures. from __future__ import annotations +from dataclasses import dataclass +from typing import Optional + +from dbt_semantic_interfaces.type_enums.time_granularity import TimeGranularity + from metricflow.test.fixtures.cli_fixtures import * # noqa: F401, F403 from metricflow.test.fixtures.dataflow_fixtures import * # noqa: F401, F403 from metricflow.test.fixtures.id_fixtures import * # noqa: F401, F403 @@ -9,3 +14,13 @@ from metricflow.test.fixtures.sql_client_fixtures import * # noqa: F401, F403 from metricflow.test.fixtures.sql_fixtures import * # noqa: F401, F403 from metricflow.test.fixtures.table_fixtures import * # noqa: F401, F403 +from metricflow.time.date_part import DatePart + + +@dataclass +class MockQueryParameter: + """This is a mock that is just used to test the query parser.""" + + name: str + grain: Optional[TimeGranularity] = None + date_part: Optional[DatePart] = None diff --git a/metricflow/test/integration/configured_test_case.py b/metricflow/test/integration/configured_test_case.py index a6c0ac8e20..766873b9b0 100644 --- a/metricflow/test/integration/configured_test_case.py +++ b/metricflow/test/integration/configured_test_case.py @@ -4,7 +4,7 @@ import os from collections import OrderedDict from enum import Enum -from typing import Optional, Sequence, Tuple +from typing import Dict, Optional, Sequence, Tuple import yaml from dbt_semantic_interfaces.implementations.base import FrozenBaseModel @@ -53,6 +53,7 @@ class Config: # noqa: D check_query: str file_path: str group_bys: Tuple[str, ...] = () + group_by_objs: Tuple[Dict, ...] = () order_bys: Tuple[str, ...] = () # The required features in the DW engine for the test to complete. required_features: Tuple[RequiredDwEngineFeatures, ...] = () diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index bd53ff686f..20c0f302d4 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1049,7 +1049,7 @@ integration_test: description: Test query using date_part model: SIMPLE_MODEL metrics: ["bookings"] - group_bys: ["metric_time__extract_year"] + group_by_objs: [{"name": "metric_time", "date_part": "year"}] check_query: | SELECT SUM(1) AS bookings @@ -1062,7 +1062,13 @@ integration_test: description: Test query using multiple date_parts model: SIMPLE_MODEL metrics: ["bookings"] - group_bys: ["metric_time__extract_quarter", "metric_time__extract_dow", "metric_time__extract_doy", "metric_time__extract_day", "metric_time__extract_week"] + group_by_objs: [ + {"name": "metric_time", "date_part": "quarter"}, + {"name": "metric_time", "date_part": "dow"}, + {"name": "metric_time", "date_part": "doy"}, + {"name": "metric_time", "date_part": "day"}, + {"name": "metric_time", "date_part": "week"}, + ] check_query: | SELECT SUM(1) AS bookings @@ -1084,7 +1090,7 @@ integration_test: description: Tests a derived metric offset query with window and date_part model: SIMPLE_MODEL metrics: ["bookings_5_day_lag"] - group_bys: ["metric_time__extract_month"] + group_by_objs: [{"name": "metric_time", "date_part": "month"}] check_query: | SELECT {{ render_extract("a.ds", DatePart.MONTH) }} AS metric_time__extract_month diff --git a/metricflow/test/integration/test_configured_cases.py b/metricflow/test/integration/test_configured_cases.py index cde625fde7..46dd07e2a3 100644 --- a/metricflow/test/integration/test_configured_cases.py +++ b/metricflow/test/integration/test_configured_cases.py @@ -2,6 +2,7 @@ import datetime import logging +from copy import copy from typing import List, Optional, Sequence, Tuple import jinja2 @@ -31,6 +32,7 @@ SqlTimeDeltaExpression, ) from metricflow.test.compare_df import assert_dataframes_equal +from metricflow.test.conftest import MockQueryParameter from metricflow.test.fixtures.setup_fixtures import MetricFlowTestSessionState from metricflow.test.integration.configured_test_case import ( CONFIGURED_INTEGRATION_TESTS_REPOSITORY, @@ -253,10 +255,18 @@ def test_case( check_query_helpers = CheckQueryHelpers(sql_client) + group_by: List[MockQueryParameter] = [] + for group_by_kwargs in case.group_by_objs: + kwargs = copy(group_by_kwargs) + date_part = kwargs.get("date_part") + if date_part: + kwargs["date_part"] = DatePart(date_part) + group_by.append(MockQueryParameter(**kwargs)) query_result = engine.query( MetricFlowQueryRequest.create_with_random_request_id( metric_names=case.metrics, group_by_names=case.group_bys, + group_by=tuple(group_by), limit=case.limit, time_constraint_start=parser.parse(case.time_constraint[0]) if case.time_constraint else None, time_constraint_end=parser.parse(case.time_constraint[1]) if case.time_constraint else None, diff --git a/metricflow/test/query/test_query_parser.py b/metricflow/test/query/test_query_parser.py index b4962b4bee..41f205ed05 100644 --- a/metricflow/test/query/test_query_parser.py +++ b/metricflow/test/query/test_query_parser.py @@ -21,9 +21,11 @@ OrderBySpec, TimeDimensionSpec, ) +from metricflow.test.conftest import MockQueryParameter from metricflow.test.fixtures.model_fixtures import query_parser_from_yaml from metricflow.test.model.example_project_configuration import EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE from metricflow.test.time.metric_time_dimension import MTD +from metricflow.time.date_part import DatePart from metricflow.time.time_granularity_solver import RequestTimeGranularityException logger = logging.getLogger(__name__) @@ -171,16 +173,6 @@ def test_query_parser(bookings_query_parser: MetricFlowQueryParser) -> None: # ) -class MockQueryParameter: - """This is a mock that is just used to test the query parser.""" - - grain = None - date_part = None - - def __init__(self, name: str): # noqa: D - self.name = name - - def test_query_parser_with_object_params(bookings_query_parser: MetricFlowQueryParser) -> None: # noqa: D Metric = namedtuple("Metric", ["name"]) metric = Metric("bookings") @@ -372,11 +364,10 @@ def test_derived_metric_query_parsing() -> None: def test_derived_metric_with_offset_parsing() -> None: """Test that querying derived metrics with a time offset requires a time dimension.""" - bookings_yaml_file = YamlConfigFile(filepath="inline_for_test_1", contents=BOOKINGS_YAML) - bookings_yaml_file = YamlConfigFile(filepath="inline_for_test_1", contents=REVENUE_YAML) + revenue_yaml_file = YamlConfigFile(filepath="inline_for_test_1", contents=REVENUE_YAML) metrics_yaml_file = YamlConfigFile(filepath="inline_for_test_1", contents=METRICS_YAML) query_parser = query_parser_from_yaml( - [EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE, bookings_yaml_file, metrics_yaml_file] + [EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE, revenue_yaml_file, metrics_yaml_file] ) # Attempt to query with no dimension with pytest.raises(UnableToSatisfyQueryError): @@ -397,3 +388,32 @@ def test_derived_metric_with_offset_parsing() -> None: metric_names=["revenue_growth_2_weeks"], group_by_names=[MTD], ) + + +def test_date_part_parsing() -> None: + """Test that querying with a date_part verifies compatibility with time_granularity.""" + revenue_yaml_file = YamlConfigFile(filepath="inline_for_test_1", contents=REVENUE_YAML) + metrics_yaml_file = YamlConfigFile(filepath="inline_for_test_1", contents=METRICS_YAML) + query_parser = query_parser_from_yaml( + [EXAMPLE_PROJECT_CONFIGURATION_YAML_CONFIG_FILE, revenue_yaml_file, metrics_yaml_file] + ) + + # Date part is incompatible with metric's defined time granularity + with pytest.raises(RequestTimeGranularityException, match="is not valid for querying"): + query_parser.parse_and_validate_query( + metric_names=["revenue"], + group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.DOW)], + ) + + # Date part is compatible with the requested time granularity for the same time dimension + with pytest.raises(RequestTimeGranularityException, match="is not compatible with time granularity"): + query_parser.parse_and_validate_query( + metric_names=["revenue"], + group_by=[MockQueryParameter(name="metric_time", grain=TimeGranularity.YEAR, date_part=DatePart.MONTH)], + ) + + # Date part is compatible + query_parser.parse_and_validate_query( + metric_names=["revenue"], + group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.MONTH)], + ) diff --git a/metricflow/test/time/test_time_granularity_solver.py b/metricflow/test/time/test_time_granularity_solver.py index 025778df10..e354881588 100644 --- a/metricflow/test/time/test_time_granularity_solver.py +++ b/metricflow/test/time/test_time_granularity_solver.py @@ -27,21 +27,21 @@ def time_granularity_solver( # noqa: D def test_validate_day_granuarity_for_day_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[MetricReference(element_name="bookings")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.DAY)], ) def test_validate_month_granuarity_for_day_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[MetricReference(element_name="bookings")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.MONTH)], ) def test_validate_month_granuarity_for_month_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.MONTH)], ) @@ -50,7 +50,7 @@ def test_validate_month_granuarity_for_month_metric(time_granularity_solver: Tim def test_validate_month_granuarity_for_day_and_month_metrics( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[MetricReference(element_name="bookings"), MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.MONTH)], ) @@ -59,7 +59,7 @@ def test_validate_month_granuarity_for_day_and_month_metrics( # noqa: D def test_validate_year_granularity_for_day_and_month_metrics( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[MetricReference(element_name="bookings"), MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.YEAR)], ) @@ -67,7 +67,7 @@ def test_validate_year_granularity_for_day_and_month_metrics( # noqa: D def test_validate_day_granuarity_for_month_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D with pytest.raises(RequestTimeGranularityException): - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.DAY)], ) @@ -77,7 +77,7 @@ def test_validate_day_granularity_for_day_and_month_metric( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: with pytest.raises(RequestTimeGranularityException): - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[ MetricReference(element_name="bookings"), MetricReference(element_name="bookings_monthly"), @@ -120,7 +120,7 @@ def test_granularity_error_for_cumulative_metric( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: with pytest.raises(RequestTimeGranularityException): - time_granularity_solver.validate_time_granularity( + time_granularity_solver.validate_time_granularity_and_date_part( metric_references=[ MetricReference(element_name="weekly_bookers"), MetricReference(element_name="bookings_monthly"), diff --git a/metricflow/time/time_granularity_solver.py b/metricflow/time/time_granularity_solver.py index 8fbf95c601..367fc832a5 100644 --- a/metricflow/time/time_granularity_solver.py +++ b/metricflow/time/time_granularity_solver.py @@ -19,6 +19,7 @@ from metricflow.specs.specs import ( TimeDimensionSpec, ) +from metricflow.time.date_part import DatePart from metricflow.time.time_granularity import ( adjust_to_end_of_period, adjust_to_start_of_period, @@ -38,6 +39,7 @@ class PartialTimeDimensionSpec: element_name: str entity_links: Tuple[EntityReference, ...] + date_part: Optional[DatePart] = None @dataclass(frozen=True) @@ -65,28 +67,34 @@ def __init__( # noqa: D ) -> None: self._semantic_manifest_lookup = semantic_manifest_lookup - def validate_time_granularity( + def validate_time_granularity_and_date_part( self, metric_references: Sequence[MetricReference], time_dimension_specs: Sequence[TimeDimensionSpec] ) -> None: - """Check that the granularity specified for time dimensions is valid with respect to the metrics. + """Check that the granularity & date_part specified for time dimensions is valid with respect to the metrics. - e.g. throw an error if "ds__week" is specified for a metric with a time granularity of MONTH. + e.g. throw an error if "ds__week" or "extract week" is specified for a metric with a time granularity of MONTH. """ valid_group_by_elements = self._semantic_manifest_lookup.metric_lookup.linkable_set_for_metrics( metric_references=metric_references, ) for time_dimension_spec in time_dimension_specs: - match_found = False + match_found_with_granularity = False + match_found_for_date_part = False for path_key in valid_group_by_elements.path_key_to_linkable_dimensions: - if ( - path_key.element_name == time_dimension_spec.element_name - and (path_key.entity_links == time_dimension_spec.entity_links) - and path_key.time_granularity == time_dimension_spec.time_granularity + if path_key.element_name == time_dimension_spec.element_name and ( + path_key.entity_links == time_dimension_spec.entity_links ): - match_found = True - break - if not match_found: + if path_key.time_granularity == time_dimension_spec.time_granularity: + match_found_with_granularity = True + if not time_dimension_spec.date_part or ( + path_key.time_granularity + and path_key.time_granularity.to_int() <= time_dimension_spec.date_part.to_int() + ): + match_found_for_date_part = True + if match_found_with_granularity and match_found_for_date_part: + break + if not (match_found_with_granularity and match_found_for_date_part): raise RequestTimeGranularityException( f"{time_dimension_spec} is not valid for querying {metric_references}" ) @@ -123,6 +131,7 @@ def resolve_granularity_for_partial_time_dimension_specs( element_name=partial_time_dimension_spec.element_name, entity_links=partial_time_dimension_spec.entity_links, time_granularity=minimum_time_granularity, + date_part=partial_time_dimension_spec.date_part, ) else: raise RequestTimeGranularityException( From 7f64a70c27a66ddc5923dec8dea629ebf8f39fe7 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 12 Sep 2023 18:17:23 -0700 Subject: [PATCH 11/15] Separate validation for date part, esp for cumulative metrics --- metricflow/query/query_parser.py | 21 ++++++++++++-- metricflow/test/query/test_query_parser.py | 13 +++++++-- .../test/time/test_time_granularity_solver.py | 16 +++++------ metricflow/time/time_granularity_solver.py | 28 ++++++++----------- 4 files changed, 47 insertions(+), 31 deletions(-) diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 329bb3bdc3..82cc913303 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -433,7 +433,8 @@ def _parse_and_validate_query( if len(time_dimension_specs) == 0: self._validate_no_time_dimension_query(metric_references=metric_references) - self._time_granularity_solver.validate_time_granularity_and_date_part(metric_references, time_dimension_specs) + self._time_granularity_solver.validate_time_granularity(metric_references, time_dimension_specs) + self._validate_date_part(metric_references, time_dimension_specs) for time_dimension_spec in time_dimension_specs: if ( time_dimension_spec.date_part @@ -508,7 +509,7 @@ def _parse_and_validate_query( raise InvalidQueryException(f"Limit was specified as {limit}, which is < 0.") if where_filter_spec: - self._time_granularity_solver.validate_time_granularity_and_date_part( + self._time_granularity_solver.validate_time_granularity( metric_references=metric_references, time_dimension_specs=where_filter_spec.linkable_spec_set.time_dimension_specs, ) @@ -546,6 +547,20 @@ def _validate_order_by_specs( ): raise InvalidQueryException(f"Order by item {order_by_spec} not in the query") + def _validate_date_part( + self, metric_references: Sequence[MetricReference], time_dimension_specs: Sequence[TimeDimensionSpec] + ) -> None: + """Validate that date parts can be used for metrics.""" + date_part_requested = False + for time_dimension_spec in time_dimension_specs: + if time_dimension_spec.date_part: + date_part_requested = True + break + + for metric_reference in metric_references: + if self._metric_lookup.get_metric(metric_reference).type == MetricType.CUMULATIVE and date_part_requested: + raise UnableToSatisfyQueryError("Cannot extract date part for cumulative metrics.") + def _adjust_time_range_constraint( self, metric_references: Sequence[MetricReference], @@ -553,7 +568,7 @@ def _adjust_time_range_constraint( time_range_constraint: TimeRangeConstraint, ) -> TimeRangeConstraint: """Adjust the time range constraint so that it matches the boundaries of the granularity of the result.""" - self._time_granularity_solver.validate_time_granularity_and_date_part(metric_references, time_dimension_specs) + self._time_granularity_solver.validate_time_granularity(metric_references, time_dimension_specs) smallest_primary_time_granularity_in_query = self._find_smallest_metric_time_dimension_spec_granularity( time_dimension_specs diff --git a/metricflow/test/query/test_query_parser.py b/metricflow/test/query/test_query_parser.py index 41f205ed05..2bba217baf 100644 --- a/metricflow/test/query/test_query_parser.py +++ b/metricflow/test/query/test_query_parser.py @@ -399,19 +399,26 @@ def test_date_part_parsing() -> None: ) # Date part is incompatible with metric's defined time granularity - with pytest.raises(RequestTimeGranularityException, match="is not valid for querying"): + with pytest.raises(RequestTimeGranularityException): query_parser.parse_and_validate_query( metric_names=["revenue"], group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.DOW)], ) - # Date part is compatible with the requested time granularity for the same time dimension - with pytest.raises(RequestTimeGranularityException, match="is not compatible with time granularity"): + # Date part is incompatible with the requested time granularity for the same time dimension + with pytest.raises(RequestTimeGranularityException): query_parser.parse_and_validate_query( metric_names=["revenue"], group_by=[MockQueryParameter(name="metric_time", grain=TimeGranularity.YEAR, date_part=DatePart.MONTH)], ) + # Can't query date part for cumulative metrics + with pytest.raises(UnableToSatisfyQueryError): + query_parser.parse_and_validate_query( + metric_names=["revenue_cumulative"], + group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.DOY)], + ) + # Date part is compatible query_parser.parse_and_validate_query( metric_names=["revenue"], diff --git a/metricflow/test/time/test_time_granularity_solver.py b/metricflow/test/time/test_time_granularity_solver.py index e354881588..025778df10 100644 --- a/metricflow/test/time/test_time_granularity_solver.py +++ b/metricflow/test/time/test_time_granularity_solver.py @@ -27,21 +27,21 @@ def time_granularity_solver( # noqa: D def test_validate_day_granuarity_for_day_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[MetricReference(element_name="bookings")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.DAY)], ) def test_validate_month_granuarity_for_day_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[MetricReference(element_name="bookings")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.MONTH)], ) def test_validate_month_granuarity_for_month_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.MONTH)], ) @@ -50,7 +50,7 @@ def test_validate_month_granuarity_for_month_metric(time_granularity_solver: Tim def test_validate_month_granuarity_for_day_and_month_metrics( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[MetricReference(element_name="bookings"), MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.MONTH)], ) @@ -59,7 +59,7 @@ def test_validate_month_granuarity_for_day_and_month_metrics( # noqa: D def test_validate_year_granularity_for_day_and_month_metrics( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[MetricReference(element_name="bookings"), MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.YEAR)], ) @@ -67,7 +67,7 @@ def test_validate_year_granularity_for_day_and_month_metrics( # noqa: D def test_validate_day_granuarity_for_month_metric(time_granularity_solver: TimeGranularitySolver) -> None: # noqa: D with pytest.raises(RequestTimeGranularityException): - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[MetricReference(element_name="bookings_monthly")], time_dimension_specs=[DataSet.metric_time_dimension_spec(TimeGranularity.DAY)], ) @@ -77,7 +77,7 @@ def test_validate_day_granularity_for_day_and_month_metric( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: with pytest.raises(RequestTimeGranularityException): - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[ MetricReference(element_name="bookings"), MetricReference(element_name="bookings_monthly"), @@ -120,7 +120,7 @@ def test_granularity_error_for_cumulative_metric( # noqa: D time_granularity_solver: TimeGranularitySolver, ) -> None: with pytest.raises(RequestTimeGranularityException): - time_granularity_solver.validate_time_granularity_and_date_part( + time_granularity_solver.validate_time_granularity( metric_references=[ MetricReference(element_name="weekly_bookers"), MetricReference(element_name="bookings_monthly"), diff --git a/metricflow/time/time_granularity_solver.py b/metricflow/time/time_granularity_solver.py index 367fc832a5..ecf6c5d13c 100644 --- a/metricflow/time/time_granularity_solver.py +++ b/metricflow/time/time_granularity_solver.py @@ -67,34 +67,28 @@ def __init__( # noqa: D ) -> None: self._semantic_manifest_lookup = semantic_manifest_lookup - def validate_time_granularity_and_date_part( + def validate_time_granularity( self, metric_references: Sequence[MetricReference], time_dimension_specs: Sequence[TimeDimensionSpec] ) -> None: - """Check that the granularity & date_part specified for time dimensions is valid with respect to the metrics. + """Check that the granularity specified for time dimensions is valid with respect to the metrics. - e.g. throw an error if "ds__week" or "extract week" is specified for a metric with a time granularity of MONTH. + e.g. throw an error if "ds__week" is specified for a metric with a time granularity of MONTH. """ valid_group_by_elements = self._semantic_manifest_lookup.metric_lookup.linkable_set_for_metrics( metric_references=metric_references, ) for time_dimension_spec in time_dimension_specs: - match_found_with_granularity = False - match_found_for_date_part = False + match_found = False for path_key in valid_group_by_elements.path_key_to_linkable_dimensions: - if path_key.element_name == time_dimension_spec.element_name and ( - path_key.entity_links == time_dimension_spec.entity_links + if ( + path_key.element_name == time_dimension_spec.element_name + and (path_key.entity_links == time_dimension_spec.entity_links) + and path_key.time_granularity == time_dimension_spec.time_granularity ): - if path_key.time_granularity == time_dimension_spec.time_granularity: - match_found_with_granularity = True - if not time_dimension_spec.date_part or ( - path_key.time_granularity - and path_key.time_granularity.to_int() <= time_dimension_spec.date_part.to_int() - ): - match_found_for_date_part = True - if match_found_with_granularity and match_found_for_date_part: - break - if not (match_found_with_granularity and match_found_for_date_part): + match_found = True + break + if not match_found: raise RequestTimeGranularityException( f"{time_dimension_spec} is not valid for querying {metric_references}" ) From 32fba86f7eed23d89a9e298fc209ad15c6918f03 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 12 Sep 2023 18:38:35 -0700 Subject: [PATCH 12/15] Temp: block date part for grain to date --- metricflow/query/query_parser.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 82cc913303..b220239631 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -550,16 +550,26 @@ def _validate_order_by_specs( def _validate_date_part( self, metric_references: Sequence[MetricReference], time_dimension_specs: Sequence[TimeDimensionSpec] ) -> None: - """Validate that date parts can be used for metrics.""" + """Validate that date parts can be used for metrics. + + TODO: figure out expected behavior for date part with these types of metrics. + """ date_part_requested = False for time_dimension_spec in time_dimension_specs: if time_dimension_spec.date_part: date_part_requested = True break - - for metric_reference in metric_references: - if self._metric_lookup.get_metric(metric_reference).type == MetricType.CUMULATIVE and date_part_requested: - raise UnableToSatisfyQueryError("Cannot extract date part for cumulative metrics.") + if date_part_requested: + for metric_reference in metric_references: + metric = self._metric_lookup.get_metric(metric_reference) + if metric.type == MetricType.CUMULATIVE: + raise UnableToSatisfyQueryError("Cannot extract date part for cumulative metrics.") + elif metric.type == MetricType.DERIVED: + for input_metric in metric.type_params.metrics or []: + if input_metric.offset_to_grain: + raise UnableToSatisfyQueryError( + "Cannot extract date part for metrics with offset_to_grain." + ) def _adjust_time_range_constraint( self, From 38761fec874fdd843f6283fe130ff64353e1ab89 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 12 Sep 2023 18:40:11 -0700 Subject: [PATCH 13/15] Temp: block date part for grain to date --- metricflow/plan_conversion/dataflow_to_sql.py | 1 - 1 file changed, 1 deletion(-) diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 84b2e0d261..1b04666460 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -1376,7 +1376,6 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode[SourceDataSetT time_granularity=metric_time_dimension_spec.time_granularity, arg=time_spine_column_select_expr ) if node.offset_to_grain: - # TODO: allow offset_to_grain w/ granularity & datepart? what's the expected behavior? # Filter down to one row per granularity period new_filter = SqlComparisonExpression( left_expr=select_expr, comparison=SqlComparison.EQUALS, right_expr=time_spine_column_select_expr From ddec74e89cc55e15784335d8ea9fdd106014da61 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 13 Sep 2023 09:12:07 -0700 Subject: [PATCH 14/15] Cleanup --- .../unreleased/Features-20230911-190924.yaml | 2 +- .../dataflow/builder/dataflow_plan_builder.py | 2 +- metricflow/naming/linkable_spec_name.py | 5 +- metricflow/query/query_parser.py | 8 +- metricflow/specs/specs.py | 1 + metricflow/sql/render/big_query.py | 6 +- .../integration/test_cases/itest_metrics.yaml | 13 + .../test/integration/test_configured_cases.py | 3 + .../test_dataflow_to_sql_plan.py | 82 + metricflow/test/query/test_query_parser.py | 32 +- ...st_convert_query_semantic_model__plan0.sql | 12 +- ...le_semantic_model_with_measures__plan0.sql | 24 +- ...semantic_model_without_measures__plan0.sql | 12 +- .../test_multihop_join_plan__dfp_0.xml | 62 +- .../test_common_semantic_model__plan0.sql | 72 +- .../test_compute_metrics_node__plan0.sql | 60 +- ...o_from_multiple_semantic_models__plan0.sql | 108 +- ...atio_from_single_semantic_model__plan0.sql | 60 +- ...ompute_metrics_node_simple_expr__plan0.sql | 60 +- .../test_constrain_time_range_node__plan0.sql | 36 +- .../test_cumulative_metric__plan0.sql | 12 +- ...cumulative_metric_grain_to_date__plan0.sql | 12 +- .../test_cumulative_metric_no_ds__plan0.sql | 12 +- ...est_cumulative_metric_no_window__plan0.sql | 12 +- ..._no_window_with_time_constraint__plan0.sql | 12 +- ...ive_metric_with_time_constraint__plan0.sql | 12 +- .../BigQuery/test_derived_metric__plan0.sql | 72 +- ...ved_metric_with_offset_to_grain__plan0.sql | 72 +- ...offset_to_grain_and_granularity__plan0.sql | 72 +- ...rived_metric_with_offset_window__plan0.sql | 72 +- ...h_offset_window_and_granularity__plan0.sql | 72 +- ...fset_window_and_offset_to_grain__plan0.sql | 72 +- ...offset_to_grain_and_granularity__plan0.sql | 72 +- ...erived_offset_cumulative_metric__plan0.sql | 36 +- ...et_metric_with_one_input_metric__plan0.sql | 36 +- .../BigQuery/test_distinct_values__plan0.sql | 60 +- .../BigQuery/test_filter_node__plan0.sql | 36 +- ...lter_with_where_constraint_node__plan0.sql | 36 +- ...th_where_constraint_on_join_dim__plan0.sql | 60 +- .../test_join_to_scd_dimension__plan0.sql | 60 +- ...spine_node_with_offset_to_grain__plan0.sql | 36 +- ...e_spine_node_with_offset_window__plan0.sql | 36 +- ..._time_spine_node_without_offset__plan0.sql | 36 +- .../BigQuery/test_limit_rows__plan0.sql | 36 +- ...al_dimension_using_local_entity__plan0.sql | 24 +- .../test_measure_aggregation_node__plan0.sql | 36 +- .../test_measure_constraint__plan0.sql | 156 +- ..._constraint_with_reused_measure__plan0.sql | 72 +- ...aint_with_single_expr_and_alias__plan0.sql | 36 +- ..._multiple_sources_no_dimensions__plan0.sql | 60 +- ...multi_hop_through_scd_dimension__plan0.sql | 100 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 116 +- .../BigQuery/test_multi_join_node__plan0.sql | 84 +- .../BigQuery/test_multihop_node__plan0.sql | 76 +- ..._multiple_metrics_no_dimensions__plan0.sql | 60 +- .../test_nested_derived_metric__plan0.sql | 144 +- ...st_offset_window_with_date_part__plan0.sql | 585 +++++ ...window_with_date_part__plan0_optimized.sql | 63 + .../BigQuery/test_order_by_node__plan0.sql | 36 +- .../BigQuery/test_partitioned_join__plan0.sql | 60 +- .../test_semi_additive_join_node__plan0.sql | 24 +- ...mi_additive_join_node__plan0_optimized.sql | 12 +- ...dditive_join_node_with_grouping__plan0.sql | 24 +- ...in_node_with_grouping__plan0_optimized.sql | 12 +- ...join_node_with_queried_group_by__plan0.sql | 24 +- ...with_queried_group_by__plan0_optimized.sql | 12 +- ...est_simple_query_with_date_part__plan0.sql | 227 ++ ..._query_with_date_part__plan0_optimized.sql | 17 + ..._query_with_multiple_date_parts__plan0.sql | 258 ++ ...h_multiple_date_parts__plan0_optimized.sql | 42 + .../BigQuery/test_single_join_node__plan0.sql | 60 +- .../BigQuery/test_source_node__plan0.sql | 36 +- .../test_source_node__plan0_optimized.sql | 36 +- ...multi_hop_through_scd_dimension__plan0.sql | 28 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 56 +- .../Databricks/test_multihop_node__plan0.sql | 28 +- ...st_offset_window_with_date_part__plan0.sql | 585 +++++ ...window_with_date_part__plan0_optimized.sql | 63 + ...est_simple_query_with_date_part__plan0.sql | 227 ++ ..._query_with_date_part__plan0_optimized.sql | 17 + ..._query_with_multiple_date_parts__plan0.sql | 258 ++ ...h_multiple_date_parts__plan0_optimized.sql | 42 + ...multi_hop_through_scd_dimension__plan0.sql | 28 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 56 +- .../DuckDB/test_multihop_node__plan0.sql | 28 +- ...st_offset_window_with_date_part__plan0.sql | 585 +++++ ...window_with_date_part__plan0_optimized.sql | 63 + ...est_simple_query_with_date_part__plan0.sql | 227 ++ ..._query_with_date_part__plan0_optimized.sql | 17 + ..._query_with_multiple_date_parts__plan0.sql | 258 ++ ...h_multiple_date_parts__plan0_optimized.sql | 42 + ...multi_hop_through_scd_dimension__plan0.sql | 28 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 56 +- .../Postgres/test_multihop_node__plan0.sql | 28 +- ...st_offset_window_with_date_part__plan0.sql | 585 +++++ ...window_with_date_part__plan0_optimized.sql | 63 + ...est_simple_query_with_date_part__plan0.sql | 227 ++ ..._query_with_date_part__plan0_optimized.sql | 17 + ..._query_with_multiple_date_parts__plan0.sql | 258 ++ ...h_multiple_date_parts__plan0_optimized.sql | 42 + ...multi_hop_through_scd_dimension__plan0.sql | 28 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 56 +- .../Redshift/test_multihop_node__plan0.sql | 28 +- ...st_offset_window_with_date_part__plan0.sql | 585 +++++ ...window_with_date_part__plan0_optimized.sql | 63 + ...est_simple_query_with_date_part__plan0.sql | 227 ++ ..._query_with_date_part__plan0_optimized.sql | 17 + ..._query_with_multiple_date_parts__plan0.sql | 258 ++ ...h_multiple_date_parts__plan0_optimized.sql | 42 + ...multi_hop_through_scd_dimension__plan0.sql | 28 +- ...test_multi_hop_to_scd_dimension__plan0.sql | 56 +- .../Snowflake/test_multihop_node__plan0.sql | 28 +- ...st_offset_window_with_date_part__plan0.sql | 585 +++++ ...window_with_date_part__plan0_optimized.sql | 63 + ...est_simple_query_with_date_part__plan0.sql | 227 ++ ..._query_with_date_part__plan0_optimized.sql | 17 + ..._query_with_multiple_date_parts__plan0.sql | 258 ++ ...h_multiple_date_parts__plan0_optimized.sql | 42 + ...multi_hop_through_scd_dimension__plan0.xml | 58 +- ...test_multi_hop_to_scd_dimension__plan0.xml | 106 +- .../test_multihop_node__plan0.xml | 62 +- ...st_offset_window_with_date_part__plan0.xml | 2165 +++++++++++++++++ ...est_simple_query_with_date_part__plan0.xml | 863 +++++++ ..._query_with_multiple_date_parts__plan0.xml | 966 ++++++++ ...orm_node_using_non_primary_time__plan0.sql | 36 +- ...sing_non_primary_time__plan0_optimized.sql | 42 +- ...ansform_node_using_primary_time__plan0.sql | 36 +- ...de_using_primary_time__plan0_optimized.sql | 42 +- ...uery_with_metric_time_dimension__plan0.sql | 72 +- .../test_joined_node_data_set__result0.txt | 42 +- 130 files changed, 13237 insertions(+), 1969 deletions(-) create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0_optimized.sql create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_offset_window_with_date_part__plan0.xml create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_date_part__plan0.xml create mode 100644 metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_multiple_date_parts__plan0.xml diff --git a/.changes/unreleased/Features-20230911-190924.yaml b/.changes/unreleased/Features-20230911-190924.yaml index 8370049390..85d9d36c35 100644 --- a/.changes/unreleased/Features-20230911-190924.yaml +++ b/.changes/unreleased/Features-20230911-190924.yaml @@ -1,5 +1,5 @@ kind: Features -body: DatePart aggregation for time dimensions +body: Enable DATE PART aggregation for time dimensions time: 2023-09-11T19:09:24.960342-07:00 custom: Author: courtneyholcomb diff --git a/metricflow/dataflow/builder/dataflow_plan_builder.py b/metricflow/dataflow/builder/dataflow_plan_builder.py index c989d43131..1445c7918f 100644 --- a/metricflow/dataflow/builder/dataflow_plan_builder.py +++ b/metricflow/dataflow/builder/dataflow_plan_builder.py @@ -792,7 +792,7 @@ def _build_aggregated_measures_from_measure_source_node( # If querying an offset metric, join to time spine. join_to_time_spine_node: Optional[JoinToTimeSpineNode] = None if metric_spec.offset_window or metric_spec.offset_to_grain: - assert metric_time_dimension_specs, "Joining to time spine requires querying with metric_time." + assert metric_time_dimension_specs, "Joining to time spine requires querying with metric time." join_to_time_spine_node = JoinToTimeSpineNode( parent_node=time_range_node or measure_recipe.measure_node, metric_time_dimension_specs=metric_time_dimension_specs, diff --git a/metricflow/naming/linkable_spec_name.py b/metricflow/naming/linkable_spec_name.py index 0e73415cd4..3a886b7faf 100644 --- a/metricflow/naming/linkable_spec_name.py +++ b/metricflow/naming/linkable_spec_name.py @@ -63,7 +63,10 @@ def from_name(qualified_name: str) -> StructuredLinkableSpecName: @property def qualified_name(self) -> str: - """Return the full name form. e.g. ds or listing__ds__month.""" + """Return the full name form. e.g. ds or listing__ds__month. + + If date_part is specified, don't include granularity in qualified_name since it will not impact the result. + """ items = list(self.entity_link_names) + [self.element_name] if self.date_part: items.append(self.date_part_suffix(date_part=self.date_part)) diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index b220239631..3cf160a559 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -702,7 +702,9 @@ def _parse_linkable_elements( for linkable_element in linkable_elements: parsed_name = StructuredLinkableSpecName.from_name(linkable_element.name) if parsed_name.time_granularity: - raise ValueError("Time granularity must be passed in the grain attribute for group_by query param.") + raise ValueError( + "Time granularity must be passed in the `grain` attribute for `group_by` query param." + ) structured_name = StructuredLinkableSpecName( entity_link_names=parsed_name.entity_link_names, element_name=parsed_name.element_name, @@ -721,15 +723,15 @@ def _parse_linkable_elements( entity_links = tuple(EntityReference(element_name=x) for x in structured_name.entity_link_names) # Create the spec based on the type of element referenced. if TimeDimensionReference(element_name=element_name) in self._known_time_dimension_element_references: - if structured_name.time_granularity: + if structured_name.time_granularity and not structured_name.date_part: time_dimension_specs.append( TimeDimensionSpec( element_name=element_name, entity_links=entity_links, time_granularity=structured_name.time_granularity, - date_part=structured_name.date_part, ) ) + # If date part is passed, remove requested granularity (to be overridden with default). else: partial_time_dimension_specs.append( PartialTimeDimensionSpec( diff --git a/metricflow/specs/specs.py b/metricflow/specs/specs.py index f065c0d693..81e1f68e23 100644 --- a/metricflow/specs/specs.py +++ b/metricflow/specs/specs.py @@ -327,6 +327,7 @@ def qualified_name(self) -> str: # noqa: D entity_link_names=tuple(x.element_name for x in self.entity_links), element_name=self.element_name, time_granularity=self.time_granularity, + date_part=self.date_part, ).qualified_name @property diff --git a/metricflow/sql/render/big_query.py b/metricflow/sql/render/big_query.py index 9b55c6a28d..4dcb42aaa3 100644 --- a/metricflow/sql/render/big_query.py +++ b/metricflow/sql/render/big_query.py @@ -133,11 +133,11 @@ def visit_date_trunc_expr(self, node: SqlDateTruncExpression) -> SqlExpressionRe @override def render_date_part(self, date_part: DatePart) -> str: if date_part == DatePart.DOY: - return "DAYOFYEAR" + return "dayofyear" if date_part == DatePart.DOW: - return "DAYOFWEEK" + return "dayofweek" if date_part == DatePart.WEEK: - return "ISOWEEK" + return "isoweek" return super().render_date_part(date_part) diff --git a/metricflow/test/integration/test_cases/itest_metrics.yaml b/metricflow/test/integration/test_cases/itest_metrics.yaml index 20c0f302d4..bc3b0ec79e 100644 --- a/metricflow/test/integration/test_cases/itest_metrics.yaml +++ b/metricflow/test/integration/test_cases/itest_metrics.yaml @@ -1104,3 +1104,16 @@ integration_test: ) b ON {{ render_date_sub("a", "ds", 5, TimeGranularity.DAY) }} = b.metric_time__day GROUP BY metric_time__extract_month +--- +integration_test: + name: date_part_overrides_granularity + description: Test query using date_part with incompatible granularity; should override granularity + model: SIMPLE_MODEL + metrics: ["bookings"] + group_by_objs: [{"name": "metric_time", "grain": "month", "date_part": "dow"}] + check_query: | + SELECT + SUM(1) AS bookings + , {{ render_extract("ds", DatePart.DOW) }} AS metric_time__extract_dow + FROM {{ source_schema }}.fct_bookings + GROUP BY {{ render_extract("ds", DatePart.DOW) }}; diff --git a/metricflow/test/integration/test_configured_cases.py b/metricflow/test/integration/test_configured_cases.py index 46dd07e2a3..28bfc0112c 100644 --- a/metricflow/test/integration/test_configured_cases.py +++ b/metricflow/test/integration/test_configured_cases.py @@ -259,8 +259,11 @@ def test_case( for group_by_kwargs in case.group_by_objs: kwargs = copy(group_by_kwargs) date_part = kwargs.get("date_part") + grain = kwargs.get("grain") if date_part: kwargs["date_part"] = DatePart(date_part) + if grain: + kwargs["grain"] = TimeGranularity(grain) group_by.append(MockQueryParameter(**kwargs)) query_result = engine.query( MetricFlowQueryRequest.create_with_random_request_id( diff --git a/metricflow/test/plan_conversion/test_dataflow_to_sql_plan.py b/metricflow/test/plan_conversion/test_dataflow_to_sql_plan.py index 0bb3ded01d..a09a5efe73 100644 --- a/metricflow/test/plan_conversion/test_dataflow_to_sql_plan.py +++ b/metricflow/test/plan_conversion/test_dataflow_to_sql_plan.py @@ -57,6 +57,7 @@ from metricflow.test.snapshot_utils import assert_plan_snapshot_text_equal from metricflow.test.sql.compare_sql_plan import assert_rendered_sql_from_plan_equal, assert_sql_plan_text_equal from metricflow.test.time.metric_time_dimension import MTD_SPEC_DAY, MTD_SPEC_QUARTER, MTD_SPEC_WEEK, MTD_SPEC_YEAR +from metricflow.time.date_part import DatePart @pytest.fixture(scope="session") @@ -1858,3 +1859,84 @@ def test_derived_offset_cumulative_metric( # noqa: D sql_client=sql_client, node=dataflow_plan.sink_output_nodes[0].parent_node, ) + + +def test_simple_query_with_date_part( # noqa: D + request: FixtureRequest, + mf_test_session_state: MetricFlowTestSessionState, + dataflow_plan_builder: DataflowPlanBuilder[SemanticModelDataSet], + dataflow_to_sql_converter: DataflowToSqlQueryPlanConverter[SemanticModelDataSet], + sql_client: SqlClient, +) -> None: + dataflow_plan = dataflow_plan_builder.build_plan( + MetricFlowQuerySpec( + metric_specs=(MetricSpec(element_name="bookings"),), + time_dimension_specs=( + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.DOW), + ), + ) + ) + + convert_and_check( + request=request, + mf_test_session_state=mf_test_session_state, + dataflow_to_sql_converter=dataflow_to_sql_converter, + sql_client=sql_client, + node=dataflow_plan.sink_output_nodes[0].parent_node, + ) + + +def test_simple_query_with_multiple_date_parts( # noqa: D + request: FixtureRequest, + mf_test_session_state: MetricFlowTestSessionState, + dataflow_plan_builder: DataflowPlanBuilder[SemanticModelDataSet], + dataflow_to_sql_converter: DataflowToSqlQueryPlanConverter[SemanticModelDataSet], + sql_client: SqlClient, +) -> None: + dataflow_plan = dataflow_plan_builder.build_plan( + MetricFlowQuerySpec( + metric_specs=(MetricSpec(element_name="bookings"),), + time_dimension_specs=( + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.DAY), + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.DOW), + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.DOY), + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.WEEK), + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.MONTH), + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.QUARTER), + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.YEAR), + ), + ) + ) + + convert_and_check( + request=request, + mf_test_session_state=mf_test_session_state, + dataflow_to_sql_converter=dataflow_to_sql_converter, + sql_client=sql_client, + node=dataflow_plan.sink_output_nodes[0].parent_node, + ) + + +def test_offset_window_with_date_part( # noqa: D + request: FixtureRequest, + mf_test_session_state: MetricFlowTestSessionState, + dataflow_plan_builder: DataflowPlanBuilder[SemanticModelDataSet], + dataflow_to_sql_converter: DataflowToSqlQueryPlanConverter[SemanticModelDataSet], + sql_client: SqlClient, +) -> None: + dataflow_plan = dataflow_plan_builder.build_plan( + MetricFlowQuerySpec( + metric_specs=(MetricSpec(element_name="bookings_growth_2_weeks"),), + time_dimension_specs=( + DataSet.metric_time_dimension_spec(time_granularity=TimeGranularity.DAY, date_part=DatePart.DOW), + ), + ) + ) + + convert_and_check( + request=request, + mf_test_session_state=mf_test_session_state, + dataflow_to_sql_converter=dataflow_to_sql_converter, + sql_client=sql_client, + node=dataflow_plan.sink_output_nodes[0].parent_node, + ) diff --git a/metricflow/test/query/test_query_parser.py b/metricflow/test/query/test_query_parser.py index 2bba217baf..b1926067b7 100644 --- a/metricflow/test/query/test_query_parser.py +++ b/metricflow/test/query/test_query_parser.py @@ -136,6 +136,18 @@ - name: revenue offset_window: 14 days alias: revenue_2_weeks_ago + --- + metric: + name: revenue_since_start_of_year + description: Revenue since start of year + type: derived + type_params: + expr: revenue - revenue_start_of_year + metrics: + - name: revenue + - name: revenue + offset_to_grain: year + alias: revenue_start_of_year """ ) @@ -405,13 +417,6 @@ def test_date_part_parsing() -> None: group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.DOW)], ) - # Date part is incompatible with the requested time granularity for the same time dimension - with pytest.raises(RequestTimeGranularityException): - query_parser.parse_and_validate_query( - metric_names=["revenue"], - group_by=[MockQueryParameter(name="metric_time", grain=TimeGranularity.YEAR, date_part=DatePart.MONTH)], - ) - # Can't query date part for cumulative metrics with pytest.raises(UnableToSatisfyQueryError): query_parser.parse_and_validate_query( @@ -419,8 +424,21 @@ def test_date_part_parsing() -> None: group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.DOY)], ) + # Can't query date part for metrics with offset to grain + with pytest.raises(UnableToSatisfyQueryError): + query_parser.parse_and_validate_query( + metric_names=["revenue_since_start_of_year"], + group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.DAY)], + ) + # Date part is compatible query_parser.parse_and_validate_query( metric_names=["revenue"], group_by=[MockQueryParameter(name="metric_time", date_part=DatePart.MONTH)], ) + + # Incompatible granularity gets overriden + query_parser.parse_and_validate_query( + metric_names=["revenue"], + group_by=[MockQueryParameter(name="metric_time", grain=TimeGranularity.YEAR, date_part=DatePart.MONTH)], + ) diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql index f00e2be64e..95c23db647 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_query_semantic_model__plan0.sql @@ -9,10 +9,10 @@ SELECT , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -21,10 +21,10 @@ SELECT , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql index b6a752aa1c..21f374f1fe 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_with_measures__plan0.sql @@ -9,10 +9,10 @@ SELECT , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds) AS ds__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month @@ -21,10 +21,10 @@ SELECT , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week @@ -34,10 +34,10 @@ SELECT , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds) AS verification__ds__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month @@ -46,10 +46,10 @@ SELECT , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user diff --git a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql index c698caae42..abec542070 100644 --- a/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql +++ b/metricflow/test/snapshots/test_convert_semantic_model.py/SqlQueryPlan/BigQuery/test_convert_table_semantic_model_without_measures__plan0.sql @@ -8,10 +8,10 @@ SELECT , EXTRACT(year FROM users_latest_src_10008.ds) AS ds__extract_year , EXTRACT(quarter FROM users_latest_src_10008.ds) AS ds__extract_quarter , EXTRACT(month FROM users_latest_src_10008.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM users_latest_src_10008.ds) AS ds__extract_week + , EXTRACT(isoweek FROM users_latest_src_10008.ds) AS ds__extract_week , EXTRACT(day FROM users_latest_src_10008.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM users_latest_src_10008.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM users_latest_src_10008.ds) AS ds__extract_doy , users_latest_src_10008.home_state_latest , users_latest_src_10008.ds AS user__ds__day , DATE_TRUNC(users_latest_src_10008.ds, isoweek) AS user__ds__week @@ -21,10 +21,10 @@ SELECT , EXTRACT(year FROM users_latest_src_10008.ds) AS user__ds__extract_year , EXTRACT(quarter FROM users_latest_src_10008.ds) AS user__ds__extract_quarter , EXTRACT(month FROM users_latest_src_10008.ds) AS user__ds__extract_month - , EXTRACT(ISOWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_week + , EXTRACT(isoweek FROM users_latest_src_10008.ds) AS user__ds__extract_week , EXTRACT(day FROM users_latest_src_10008.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10008.ds) AS user__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10008.ds) AS user__ds__extract_doy + , EXTRACT(dayofweek FROM users_latest_src_10008.ds) AS user__ds__extract_dow + , EXTRACT(dayofyear FROM users_latest_src_10008.ds) AS user__ds__extract_doy , users_latest_src_10008.home_state_latest AS user__home_state_latest , users_latest_src_10008.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10008 diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml index 4b1abcc4e0..108556d708 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml @@ -138,37 +138,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql index 8d272a50fc..eda032ff2f 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_common_semantic_model__plan0.sql @@ -153,10 +153,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -165,10 +165,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -177,10 +177,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -190,10 +190,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -202,10 +202,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -214,10 +214,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -382,10 +382,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -394,10 +394,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -406,10 +406,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -419,10 +419,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -431,10 +431,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -443,10 +443,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql index fdcc14c145..ed7c79b643 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node__plan0.sql @@ -47,10 +47,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -59,10 +59,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -71,10 +71,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -84,10 +84,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -96,10 +96,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -108,10 +108,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,10 +141,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -153,10 +153,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,10 +168,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -180,10 +180,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql index a0d4381867..178465c7ed 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_multiple_semantic_models__plan0.sql @@ -177,10 +177,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -189,10 +189,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -201,10 +201,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -214,10 +214,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -226,10 +226,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -238,10 +238,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -347,10 +347,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -359,10 +359,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -374,10 +374,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -386,10 +386,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -522,10 +522,10 @@ FROM ( , EXTRACT(year FROM views_source_src_10009.ds) AS ds__extract_year , EXTRACT(quarter FROM views_source_src_10009.ds) AS ds__extract_quarter , EXTRACT(month FROM views_source_src_10009.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM views_source_src_10009.ds) AS ds__extract_week + , EXTRACT(isoweek FROM views_source_src_10009.ds) AS ds__extract_week , EXTRACT(day FROM views_source_src_10009.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM views_source_src_10009.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM views_source_src_10009.ds) AS ds__extract_doy , views_source_src_10009.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(views_source_src_10009.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(views_source_src_10009.ds_partitioned, month) AS ds_partitioned__month @@ -534,10 +534,10 @@ FROM ( , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM views_source_src_10009.ds_partitioned) AS ds_partitioned__extract_doy , views_source_src_10009.ds AS view__ds__day , DATE_TRUNC(views_source_src_10009.ds, isoweek) AS view__ds__week , DATE_TRUNC(views_source_src_10009.ds, month) AS view__ds__month @@ -546,10 +546,10 @@ FROM ( , EXTRACT(year FROM views_source_src_10009.ds) AS view__ds__extract_year , EXTRACT(quarter FROM views_source_src_10009.ds) AS view__ds__extract_quarter , EXTRACT(month FROM views_source_src_10009.ds) AS view__ds__extract_month - , EXTRACT(ISOWEEK FROM views_source_src_10009.ds) AS view__ds__extract_week + , EXTRACT(isoweek FROM views_source_src_10009.ds) AS view__ds__extract_week , EXTRACT(day FROM views_source_src_10009.ds) AS view__ds__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds) AS view__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds) AS view__ds__extract_doy + , EXTRACT(dayofweek FROM views_source_src_10009.ds) AS view__ds__extract_dow + , EXTRACT(dayofyear FROM views_source_src_10009.ds) AS view__ds__extract_doy , views_source_src_10009.ds_partitioned AS view__ds_partitioned__day , DATE_TRUNC(views_source_src_10009.ds_partitioned, isoweek) AS view__ds_partitioned__week , DATE_TRUNC(views_source_src_10009.ds_partitioned, month) AS view__ds_partitioned__month @@ -558,10 +558,10 @@ FROM ( , EXTRACT(year FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_year , EXTRACT(quarter FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_quarter , EXTRACT(month FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week + , EXTRACT(isoweek FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_week , EXTRACT(day FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM views_source_src_10009.ds_partitioned) AS view__ds_partitioned__extract_doy , views_source_src_10009.listing_id AS listing , views_source_src_10009.user_id AS user , views_source_src_10009.listing_id AS view__listing @@ -665,10 +665,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -677,10 +677,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -692,10 +692,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -704,10 +704,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql index ad59db3e71..8969f7a6c0 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_ratio_from_single_semantic_model__plan0.sql @@ -50,10 +50,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -62,10 +62,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -74,10 +74,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -87,10 +87,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -99,10 +99,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -111,10 +111,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -144,10 +144,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -156,10 +156,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -171,10 +171,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -183,10 +183,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql index 4d1af3e704..1ddd22d435 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_compute_metrics_node_simple_expr__plan0.sql @@ -47,10 +47,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -59,10 +59,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -71,10 +71,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -84,10 +84,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -96,10 +96,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -108,10 +108,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -141,10 +141,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -153,10 +153,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -168,10 +168,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -180,10 +180,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql index 539cd1c2ea..7e50393d6d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_constrain_time_range_node__plan0.sql @@ -41,10 +41,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -53,10 +53,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -65,10 +65,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -78,10 +78,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -90,10 +90,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -102,10 +102,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql index c60a8f1013..bd9b392402 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric__plan0.sql @@ -67,10 +67,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -79,10 +79,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql index c2e7e2ba3a..639e816eb6 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_grain_to_date__plan0.sql @@ -67,10 +67,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -79,10 +79,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql index 5690d18f05..cd58d0ce0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_ds__plan0.sql @@ -64,10 +64,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -76,10 +76,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql index 958cb5faa4..35cc71b613 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window__plan0.sql @@ -67,10 +67,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -79,10 +79,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql index 431635cda5..829e30ded9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_no_window_with_time_constraint__plan0.sql @@ -109,10 +109,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -121,10 +121,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql index f16e293fe0..c8630b8f49 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_cumulative_metric_with_time_constraint__plan0.sql @@ -109,10 +109,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS ds__extract_doy , revenue_src_10006.created_at AS company__ds__day , DATE_TRUNC(revenue_src_10006.created_at, isoweek) AS company__ds__week , DATE_TRUNC(revenue_src_10006.created_at, month) AS company__ds__month @@ -121,10 +121,10 @@ FROM ( , EXTRACT(year FROM revenue_src_10006.created_at) AS company__ds__extract_year , EXTRACT(quarter FROM revenue_src_10006.created_at) AS company__ds__extract_quarter , EXTRACT(month FROM revenue_src_10006.created_at) AS company__ds__extract_month - , EXTRACT(ISOWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_week + , EXTRACT(isoweek FROM revenue_src_10006.created_at) AS company__ds__extract_week , EXTRACT(day FROM revenue_src_10006.created_at) AS company__ds__extract_day - , EXTRACT(DAYOFWEEK FROM revenue_src_10006.created_at) AS company__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM revenue_src_10006.created_at) AS company__ds__extract_doy + , EXTRACT(dayofweek FROM revenue_src_10006.created_at) AS company__ds__extract_dow + , EXTRACT(dayofyear FROM revenue_src_10006.created_at) AS company__ds__extract_doy , revenue_src_10006.user_id AS user , revenue_src_10006.user_id AS company__user FROM ***************************.fct_revenue revenue_src_10006 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql index 2982019f1d..ffc899b824 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric__plan0.sql @@ -158,10 +158,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -170,10 +170,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -182,10 +182,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -195,10 +195,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -207,10 +207,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -387,10 +387,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -399,10 +399,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -411,10 +411,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -424,10 +424,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -436,10 +436,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -448,10 +448,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql index 9b40278672..2705007543 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain__plan0.sql @@ -158,10 +158,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -170,10 +170,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -182,10 +182,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -195,10 +195,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -207,10 +207,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -490,10 +490,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -502,10 +502,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -514,10 +514,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -527,10 +527,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -539,10 +539,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -551,10 +551,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql index 2ab4211e28..7d7c920907 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_to_grain_and_granularity__plan0.sql @@ -158,10 +158,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -170,10 +170,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -182,10 +182,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -195,10 +195,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -207,10 +207,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -490,10 +490,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -502,10 +502,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -514,10 +514,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -527,10 +527,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -539,10 +539,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -551,10 +551,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql index b344f149a4..62768ac034 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window__plan0.sql @@ -158,10 +158,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -170,10 +170,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -182,10 +182,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -195,10 +195,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -207,10 +207,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -490,10 +490,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -502,10 +502,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -514,10 +514,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -527,10 +527,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -539,10 +539,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -551,10 +551,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql index 8028b1f148..229acaf841 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_granularity__plan0.sql @@ -158,10 +158,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -170,10 +170,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -182,10 +182,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -195,10 +195,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -207,10 +207,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -490,10 +490,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -502,10 +502,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -514,10 +514,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -527,10 +527,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -539,10 +539,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -551,10 +551,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql index 64d1c8125b..a4c8b503e4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain__plan0.sql @@ -261,10 +261,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -273,10 +273,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -285,10 +285,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -298,10 +298,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -310,10 +310,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -322,10 +322,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -596,10 +596,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -608,10 +608,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -620,10 +620,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -633,10 +633,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -645,10 +645,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -657,10 +657,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql index 3bf4e0e3cd..9107fdbe8a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_metric_with_offset_window_and_offset_to_grain_and_granularity__plan0.sql @@ -261,10 +261,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -273,10 +273,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -285,10 +285,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -298,10 +298,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -310,10 +310,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -322,10 +322,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -597,10 +597,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -609,10 +609,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -621,10 +621,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -634,10 +634,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -646,10 +646,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -658,10 +658,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql index b6f236cde8..0d9742944b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_cumulative_metric__plan0.sql @@ -369,10 +369,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -381,10 +381,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -393,10 +393,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -406,10 +406,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -418,10 +418,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -430,10 +430,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql index 4d754919c2..13415b0ae2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_derived_offset_metric_with_one_input_metric__plan0.sql @@ -255,10 +255,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -267,10 +267,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -279,10 +279,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -292,10 +292,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -304,10 +304,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -316,10 +316,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql index 9373149736..5c0e215038 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_distinct_values__plan0.sql @@ -168,10 +168,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -180,10 +180,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -192,10 +192,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -205,10 +205,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -217,10 +217,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -229,10 +229,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -338,10 +338,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -350,10 +350,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -365,10 +365,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -377,10 +377,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql index 84160306fc..12f6f6e38a 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_node__plan0.sql @@ -28,10 +28,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -40,10 +40,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -52,10 +52,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -65,10 +65,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -77,10 +77,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -89,10 +89,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql index 74d3cae54a..d13bb8fafe 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_node__plan0.sql @@ -34,10 +34,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -46,10 +46,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -71,10 +71,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -83,10 +83,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -95,10 +95,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql index 0352822f08..a4205ece06 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_filter_with_where_constraint_on_join_dim__plan0.sql @@ -174,10 +174,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -186,10 +186,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -198,10 +198,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -211,10 +211,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -223,10 +223,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -235,10 +235,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -344,10 +344,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -356,10 +356,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -371,10 +371,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -383,10 +383,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql index 1ebeb96fdf..1d933aaf04 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_scd_dimension__plan0.sql @@ -162,10 +162,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month @@ -174,10 +174,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month @@ -186,10 +186,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week @@ -199,10 +199,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month @@ -211,10 +211,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month @@ -223,10 +223,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -258,10 +258,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_from) AS window_start__extract_week , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS window_end__month @@ -270,10 +270,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_to) AS window_end__extract_week , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -285,10 +285,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_from) AS listing__window_start__extract_week , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS listing__window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS listing__window_end__month @@ -297,10 +297,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_to) AS listing__window_end__extract_week , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql index f40b5933ab..fd5aaaa276 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_to_grain__plan0.sql @@ -163,10 +163,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -175,10 +175,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -187,10 +187,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -200,10 +200,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -212,10 +212,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -224,10 +224,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql index bdb3b55b6b..438ffdddad 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_with_offset_window__plan0.sql @@ -163,10 +163,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -175,10 +175,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -187,10 +187,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -200,10 +200,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -212,10 +212,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -224,10 +224,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql index f0523526b9..919c372968 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_join_to_time_spine_node_without_offset__plan0.sql @@ -163,10 +163,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -175,10 +175,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -187,10 +187,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -200,10 +200,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -212,10 +212,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -224,10 +224,10 @@ INNER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql index 8aac1294f0..9bedbf14e2 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_limit_rows__plan0.sql @@ -152,10 +152,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -164,10 +164,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -176,10 +176,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -189,10 +189,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -201,10 +201,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -213,10 +213,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql index bc42027f9e..5ee683c896 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_local_dimension_using_local_entity__plan0.sql @@ -102,10 +102,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -114,10 +114,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -129,10 +129,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -141,10 +141,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql index 7cffe26a94..ff2afccd69 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_aggregation_node__plan0.sql @@ -38,10 +38,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -50,10 +50,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -62,10 +62,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -75,10 +75,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -87,10 +87,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -99,10 +99,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql index 451625b47c..77cede8ad4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint__plan0.sql @@ -186,10 +186,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -198,10 +198,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -210,10 +210,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -223,10 +223,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -235,10 +235,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -247,10 +247,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -356,10 +356,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -368,10 +368,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -383,10 +383,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -395,10 +395,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -597,10 +597,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -609,10 +609,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -621,10 +621,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -634,10 +634,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -646,10 +646,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -658,10 +658,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -767,10 +767,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -779,10 +779,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -794,10 +794,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -806,10 +806,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -991,10 +991,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -1003,10 +1003,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -1015,10 +1015,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -1028,10 +1028,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -1040,10 +1040,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -1052,10 +1052,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql index 74ac44eb4b..2431233751 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_reused_measure__plan0.sql @@ -171,10 +171,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -183,10 +183,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -195,10 +195,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -208,10 +208,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -220,10 +220,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -232,10 +232,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -403,10 +403,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -415,10 +415,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -427,10 +427,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -440,10 +440,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -452,10 +452,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -464,10 +464,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql index 6afff7eaab..c9052ccd01 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_measure_constraint_with_single_expr_and_alias__plan0.sql @@ -165,10 +165,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -177,10 +177,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -189,10 +189,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -202,10 +202,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -214,10 +214,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -226,10 +226,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql index e0d87aa819..78bc20baf3 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_metric_with_measures_from_multiple_sources_no_dimensions__plan0.sql @@ -153,10 +153,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -165,10 +165,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -177,10 +177,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -190,10 +190,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -202,10 +202,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -214,10 +214,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -332,10 +332,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -344,10 +344,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -359,10 +359,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -371,10 +371,10 @@ FROM ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql index ba0780ad72..fa17fe59fa 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_through_scd_dimension__plan0.sql @@ -152,10 +152,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month @@ -164,10 +164,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month @@ -176,10 +176,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week @@ -189,10 +189,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month @@ -201,10 +201,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month @@ -213,10 +213,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -321,10 +321,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_from) AS window_start__extract_year , EXTRACT(quarter FROM listings_src_10017.active_from) AS window_start__extract_quarter , EXTRACT(month FROM listings_src_10017.active_from) AS window_start__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS window_start__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_from) AS window_start__extract_week , EXTRACT(day FROM listings_src_10017.active_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS window_start__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_from) AS window_start__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_from) AS window_start__extract_doy , listings_src_10017.active_to AS window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS window_end__month @@ -333,10 +333,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_to) AS window_end__extract_year , EXTRACT(quarter FROM listings_src_10017.active_to) AS window_end__extract_quarter , EXTRACT(month FROM listings_src_10017.active_to) AS window_end__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS window_end__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_to) AS window_end__extract_week , EXTRACT(day FROM listings_src_10017.active_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS window_end__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_to) AS window_end__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_to) AS window_end__extract_doy , listings_src_10017.country , listings_src_10017.is_lux , listings_src_10017.capacity @@ -348,10 +348,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_from) AS listing__window_start__extract_year , EXTRACT(quarter FROM listings_src_10017.active_from) AS listing__window_start__extract_quarter , EXTRACT(month FROM listings_src_10017.active_from) AS listing__window_start__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_from) AS listing__window_start__extract_week , EXTRACT(day FROM listings_src_10017.active_from) AS listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_from) AS listing__window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_from) AS listing__window_start__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_from) AS listing__window_start__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_from) AS listing__window_start__extract_doy , listings_src_10017.active_to AS listing__window_end__day , DATE_TRUNC(listings_src_10017.active_to, isoweek) AS listing__window_end__week , DATE_TRUNC(listings_src_10017.active_to, month) AS listing__window_end__month @@ -360,10 +360,10 @@ FROM ( , EXTRACT(year FROM listings_src_10017.active_to) AS listing__window_end__extract_year , EXTRACT(quarter FROM listings_src_10017.active_to) AS listing__window_end__extract_quarter , EXTRACT(month FROM listings_src_10017.active_to) AS listing__window_end__extract_month - , EXTRACT(ISOWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_week + , EXTRACT(isoweek FROM listings_src_10017.active_to) AS listing__window_end__extract_week , EXTRACT(day FROM listings_src_10017.active_to) AS listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM listings_src_10017.active_to) AS listing__window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_src_10017.active_to) AS listing__window_end__extract_doy + , EXTRACT(dayofweek FROM listings_src_10017.active_to) AS listing__window_end__extract_dow + , EXTRACT(dayofyear FROM listings_src_10017.active_to) AS listing__window_end__extract_doy , listings_src_10017.country AS listing__country , listings_src_10017.is_lux AS listing__is_lux , listings_src_10017.capacity AS listing__capacity @@ -381,25 +381,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', + -- 'ds__extract_year', + -- 'ds__extract_quarter', + -- 'ds__extract_month', + -- 'ds__extract_week', + -- 'ds__extract_day', + -- 'ds__extract_dow', + -- 'ds__extract_doy', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', + -- 'user__ds__extract_year', + -- 'user__ds__extract_quarter', + -- 'user__ds__extract_month', + -- 'user__ds__extract_week', + -- 'user__ds__extract_day', + -- 'user__ds__extract_dow', + -- 'user__ds__extract_doy', -- 'user'] SELECT subq_4.ds__day @@ -440,10 +440,10 @@ FROM ( , EXTRACT(year FROM users_latest_src_10021.ds) AS ds__extract_year , EXTRACT(quarter FROM users_latest_src_10021.ds) AS ds__extract_quarter , EXTRACT(month FROM users_latest_src_10021.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM users_latest_src_10021.ds) AS ds__extract_week + , EXTRACT(isoweek FROM users_latest_src_10021.ds) AS ds__extract_week , EXTRACT(day FROM users_latest_src_10021.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM users_latest_src_10021.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM users_latest_src_10021.ds) AS ds__extract_doy , users_latest_src_10021.home_state_latest , users_latest_src_10021.ds AS user__ds__day , DATE_TRUNC(users_latest_src_10021.ds, isoweek) AS user__ds__week @@ -453,10 +453,10 @@ FROM ( , EXTRACT(year FROM users_latest_src_10021.ds) AS user__ds__extract_year , EXTRACT(quarter FROM users_latest_src_10021.ds) AS user__ds__extract_quarter , EXTRACT(month FROM users_latest_src_10021.ds) AS user__ds__extract_month - , EXTRACT(ISOWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_week + , EXTRACT(isoweek FROM users_latest_src_10021.ds) AS user__ds__extract_week , EXTRACT(day FROM users_latest_src_10021.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_latest_src_10021.ds) AS user__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_latest_src_10021.ds) AS user__ds__extract_doy + , EXTRACT(dayofweek FROM users_latest_src_10021.ds) AS user__ds__extract_dow + , EXTRACT(dayofyear FROM users_latest_src_10021.ds) AS user__ds__extract_doy , users_latest_src_10021.home_state_latest AS user__home_state_latest , users_latest_src_10021.user_id AS user FROM ***************************.dim_users_latest users_latest_src_10021 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql index 62d24b00ba..eb008dd112 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_hop_to_scd_dimension__plan0.sql @@ -152,10 +152,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds) AS ds__extract_doy , bookings_source_src_10015.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS ds_partitioned__month @@ -164,10 +164,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS paid_at__month @@ -176,10 +176,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.paid_at) AS paid_at__extract_doy , bookings_source_src_10015.is_instant AS booking__is_instant , bookings_source_src_10015.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10015.ds, isoweek) AS booking__ds__week @@ -189,10 +189,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds) AS booking__ds__extract_doy , bookings_source_src_10015.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10015.ds_partitioned, month) AS booking__ds_partitioned__month @@ -201,10 +201,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10015.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10015.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10015.paid_at, month) AS booking__paid_at__month @@ -213,10 +213,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10015.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10015.listing_id AS listing , bookings_source_src_10015.guest_id AS guest , bookings_source_src_10015.host_id AS host @@ -288,49 +288,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', + -- 'window_start__extract_year', + -- 'window_start__extract_quarter', + -- 'window_start__extract_month', + -- 'window_start__extract_week', + -- 'window_start__extract_day', + -- 'window_start__extract_dow', + -- 'window_start__extract_doy', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', + -- 'window_end__extract_year', + -- 'window_end__extract_quarter', + -- 'window_end__extract_month', + -- 'window_end__extract_week', + -- 'window_end__extract_day', + -- 'window_end__extract_dow', + -- 'window_end__extract_doy', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__extract_year', + -- 'lux_listing__window_start__extract_quarter', + -- 'lux_listing__window_start__extract_month', + -- 'lux_listing__window_start__extract_week', + -- 'lux_listing__window_start__extract_day', + -- 'lux_listing__window_start__extract_dow', + -- 'lux_listing__window_start__extract_doy', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__extract_year', + -- 'lux_listing__window_end__extract_quarter', + -- 'lux_listing__window_end__extract_month', + -- 'lux_listing__window_end__extract_week', + -- 'lux_listing__window_end__extract_day', + -- 'lux_listing__window_end__extract_dow', + -- 'lux_listing__window_end__extract_doy', -- 'lux_listing'] SELECT subq_4.window_start__day @@ -395,10 +395,10 @@ FROM ( , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS window_start__extract_year , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS window_start__extract_quarter , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS window_start__extract_month - , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_week + , EXTRACT(isoweek FROM lux_listings_src_10019.valid_from) AS window_start__extract_week , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy + , EXTRACT(dayofweek FROM lux_listings_src_10019.valid_from) AS window_start__extract_dow + , EXTRACT(dayofyear FROM lux_listings_src_10019.valid_from) AS window_start__extract_doy , lux_listings_src_10019.valid_to AS window_end__day , DATE_TRUNC(lux_listings_src_10019.valid_to, isoweek) AS window_end__week , DATE_TRUNC(lux_listings_src_10019.valid_to, month) AS window_end__month @@ -407,10 +407,10 @@ FROM ( , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS window_end__extract_year , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS window_end__extract_quarter , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS window_end__extract_month - , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_week + , EXTRACT(isoweek FROM lux_listings_src_10019.valid_to) AS window_end__extract_week , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy + , EXTRACT(dayofweek FROM lux_listings_src_10019.valid_to) AS window_end__extract_dow + , EXTRACT(dayofyear FROM lux_listings_src_10019.valid_to) AS window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux , lux_listings_src_10019.valid_from AS lux_listing__window_start__day , DATE_TRUNC(lux_listings_src_10019.valid_from, isoweek) AS lux_listing__window_start__week @@ -420,10 +420,10 @@ FROM ( , EXTRACT(year FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_year , EXTRACT(quarter FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_quarter , EXTRACT(month FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_month - , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week + , EXTRACT(isoweek FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_week , EXTRACT(day FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy + , EXTRACT(dayofweek FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_dow + , EXTRACT(dayofyear FROM lux_listings_src_10019.valid_from) AS lux_listing__window_start__extract_doy , lux_listings_src_10019.valid_to AS lux_listing__window_end__day , DATE_TRUNC(lux_listings_src_10019.valid_to, isoweek) AS lux_listing__window_end__week , DATE_TRUNC(lux_listings_src_10019.valid_to, month) AS lux_listing__window_end__month @@ -432,10 +432,10 @@ FROM ( , EXTRACT(year FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_year , EXTRACT(quarter FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_quarter , EXTRACT(month FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_month - , EXTRACT(ISOWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week + , EXTRACT(isoweek FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_week , EXTRACT(day FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_day - , EXTRACT(DAYOFWEEK FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow - , EXTRACT(DAYOFYEAR FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy + , EXTRACT(dayofweek FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_dow + , EXTRACT(dayofyear FROM lux_listings_src_10019.valid_to) AS lux_listing__window_end__extract_doy , lux_listings_src_10019.is_confirmed_lux AS lux_listing__is_confirmed_lux , lux_listings_src_10019.lux_listing_id AS lux_listing FROM ***************************.dim_lux_listings lux_listings_src_10019 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql index 0b80e4d74f..7896f7776d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multi_join_node__plan0.sql @@ -36,10 +36,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -48,10 +48,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -60,10 +60,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -73,10 +73,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -85,10 +85,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -97,10 +97,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -130,10 +130,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -142,10 +142,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -157,10 +157,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -169,10 +169,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest @@ -204,10 +204,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -216,10 +216,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -231,10 +231,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -243,10 +243,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql index 7e7b3ab4ea..59e26e6b2d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multihop_node__plan0.sql @@ -107,10 +107,10 @@ FROM ( , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM account_month_txns_src_10010.ds_partitioned) AS ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS ds__day , DATE_TRUNC(account_month_txns_src_10010.ds, isoweek) AS ds__week , DATE_TRUNC(account_month_txns_src_10010.ds, month) AS ds__month @@ -119,10 +119,10 @@ FROM ( , EXTRACT(year FROM account_month_txns_src_10010.ds) AS ds__extract_year , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS ds__extract_quarter , EXTRACT(month FROM account_month_txns_src_10010.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_week + , EXTRACT(isoweek FROM account_month_txns_src_10010.ds) AS ds__extract_week , EXTRACT(day FROM account_month_txns_src_10010.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM account_month_txns_src_10010.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM account_month_txns_src_10010.ds) AS ds__extract_doy , account_month_txns_src_10010.account_month , account_month_txns_src_10010.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC(account_month_txns_src_10010.ds_partitioned, isoweek) AS account_id__ds_partitioned__week @@ -132,10 +132,10 @@ FROM ( , EXTRACT(year FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_year , EXTRACT(quarter FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_quarter , EXTRACT(month FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(isoweek FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_week , EXTRACT(day FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM account_month_txns_src_10010.ds_partitioned) AS account_id__ds_partitioned__extract_doy , account_month_txns_src_10010.ds AS account_id__ds__day , DATE_TRUNC(account_month_txns_src_10010.ds, isoweek) AS account_id__ds__week , DATE_TRUNC(account_month_txns_src_10010.ds, month) AS account_id__ds__month @@ -144,10 +144,10 @@ FROM ( , EXTRACT(year FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_year , EXTRACT(quarter FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_quarter , EXTRACT(month FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_month - , EXTRACT(ISOWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week + , EXTRACT(isoweek FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_week , EXTRACT(day FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_day - , EXTRACT(DAYOFWEEK FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy + , EXTRACT(dayofweek FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_dow + , EXTRACT(dayofyear FROM account_month_txns_src_10010.ds) AS account_id__ds__extract_doy , account_month_txns_src_10010.account_month AS account_id__account_month , account_month_txns_src_10010.account_id FROM ***************************.account_month_txns account_month_txns_src_10010 @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bridge_table_src_10011.ds_partitioned) AS ds_partitioned__extract_doy , bridge_table_src_10011.extra_dim AS account_id__extra_dim , bridge_table_src_10011.ds_partitioned AS account_id__ds_partitioned__day , DATE_TRUNC(bridge_table_src_10011.ds_partitioned, isoweek) AS account_id__ds_partitioned__week @@ -232,10 +232,10 @@ FROM ( , EXTRACT(year FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_year , EXTRACT(quarter FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_quarter , EXTRACT(month FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_week , EXTRACT(day FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bridge_table_src_10011.ds_partitioned) AS account_id__ds_partitioned__extract_doy , bridge_table_src_10011.account_id , bridge_table_src_10011.customer_id , bridge_table_src_10011.customer_id AS account_id__customer_id @@ -252,25 +252,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', + -- 'ds_partitioned__extract_year', + -- 'ds_partitioned__extract_quarter', + -- 'ds_partitioned__extract_month', + -- 'ds_partitioned__extract_week', + -- 'ds_partitioned__extract_day', + -- 'ds_partitioned__extract_dow', + -- 'ds_partitioned__extract_doy', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__extract_year', + -- 'customer_id__ds_partitioned__extract_quarter', + -- 'customer_id__ds_partitioned__extract_month', + -- 'customer_id__ds_partitioned__extract_week', + -- 'customer_id__ds_partitioned__extract_day', + -- 'customer_id__ds_partitioned__extract_dow', + -- 'customer_id__ds_partitioned__extract_doy', -- 'customer_id'] SELECT subq_4.ds_partitioned__day @@ -315,10 +315,10 @@ FROM ( , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM customer_table_src_10013.ds_partitioned) AS ds_partitioned__extract_doy , customer_table_src_10013.customer_name AS customer_id__customer_name , customer_table_src_10013.customer_atomic_weight AS customer_id__customer_atomic_weight , customer_table_src_10013.ds_partitioned AS customer_id__ds_partitioned__day @@ -329,10 +329,10 @@ FROM ( , EXTRACT(year FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_year , EXTRACT(quarter FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_quarter , EXTRACT(month FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week + , EXTRACT(isoweek FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_week , EXTRACT(day FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM customer_table_src_10013.ds_partitioned) AS customer_id__ds_partitioned__extract_doy , customer_table_src_10013.customer_id FROM ***************************.customer_table customer_table_src_10013 ) subq_4 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql index 83d7b73587..a6f0b3d5fc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_multiple_metrics_no_dimensions__plan0.sql @@ -257,10 +257,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -269,10 +269,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -281,10 +281,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -294,10 +294,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -306,10 +306,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -318,10 +318,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -513,10 +513,10 @@ CROSS JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -525,10 +525,10 @@ CROSS JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -540,10 +540,10 @@ CROSS JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -552,10 +552,10 @@ CROSS JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql index 9037a9f0bb..189d129aa7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_nested_derived_metric__plan0.sql @@ -170,10 +170,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -182,10 +182,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -194,10 +194,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -207,10 +207,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -219,10 +219,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -231,10 +231,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -399,10 +399,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -411,10 +411,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -423,10 +423,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -436,10 +436,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -448,10 +448,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -460,10 +460,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -640,10 +640,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -652,10 +652,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -664,10 +664,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -677,10 +677,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -689,10 +689,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -701,10 +701,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -879,10 +879,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -891,10 +891,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -903,10 +903,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -916,10 +916,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -928,10 +928,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -940,10 +940,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql new file mode 100644 index 0000000000..f5af97ec20 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0.sql @@ -0,0 +1,585 @@ +-- Compute Metrics via Expressions +SELECT + subq_13.metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_4.metric_time__extract_dow, subq_12.metric_time__extract_dow) AS metric_time__extract_dow + , subq_4.bookings AS bookings + , subq_12.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Compute Metrics via Expressions + SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings + FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + metric_time__extract_dow + ) subq_3 + ) subq_4 + INNER JOIN ( + -- Compute Metrics via Expressions + SELECT + subq_11.metric_time__extract_dow + , subq_11.bookings AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + SELECT + subq_10.metric_time__extract_dow + , SUM(subq_10.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_9.metric_time__extract_dow + , subq_9.bookings + FROM ( + -- Join to Time Spine Dataset + SELECT + EXTRACT(dayofweek FROM subq_7.metric_time__day) AS metric_time__extract_dow + , subq_6.ds__day AS ds__day + , subq_6.ds__week AS ds__week + , subq_6.ds__month AS ds__month + , subq_6.ds__quarter AS ds__quarter + , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy + , subq_6.ds_partitioned__day AS ds_partitioned__day + , subq_6.ds_partitioned__week AS ds_partitioned__week + , subq_6.ds_partitioned__month AS ds_partitioned__month + , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter + , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy + , subq_6.paid_at__day AS paid_at__day + , subq_6.paid_at__week AS paid_at__week + , subq_6.paid_at__month AS paid_at__month + , subq_6.paid_at__quarter AS paid_at__quarter + , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__day AS booking__ds__day + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy + , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day + , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week + , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month + , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter + , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy + , subq_6.booking__paid_at__day AS booking__paid_at__day + , subq_6.booking__paid_at__week AS booking__paid_at__week + , subq_6.booking__paid_at__month AS booking__paid_at__month + , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter + , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.listing AS listing + , subq_6.guest AS guest + , subq_6.host AS host + , subq_6.booking__listing AS booking__listing + , subq_6.booking__guest AS booking__guest + , subq_6.booking__host AS booking__host + , subq_6.is_instant AS is_instant + , subq_6.booking__is_instant AS booking__is_instant + , subq_6.bookings AS bookings + , subq_6.instant_bookings AS instant_bookings + , subq_6.booking_value AS booking_value + , subq_6.max_booking_value AS max_booking_value + , subq_6.min_booking_value AS min_booking_value + , subq_6.bookers AS bookers + , subq_6.average_booking_value AS average_booking_value + , subq_6.referred_bookings AS referred_bookings + , subq_6.median_booking_value AS median_booking_value + , subq_6.booking_value_p99 AS booking_value_p99 + , subq_6.discrete_booking_value_p99 AS discrete_booking_value_p99 + , subq_6.approximate_continuous_booking_value_p99 AS approximate_continuous_booking_value_p99 + , subq_6.approximate_discrete_booking_value_p99 AS approximate_discrete_booking_value_p99 + FROM ( + -- Date Spine + SELECT + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + ) subq_7 + INNER JOIN ( + -- Metric Time Dimension 'ds' + SELECT + subq_5.ds__day + , subq_5.ds__week + , subq_5.ds__month + , subq_5.ds__quarter + , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy + , subq_5.ds_partitioned__day + , subq_5.ds_partitioned__week + , subq_5.ds_partitioned__month + , subq_5.ds_partitioned__quarter + , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy + , subq_5.paid_at__day + , subq_5.paid_at__week + , subq_5.paid_at__month + , subq_5.paid_at__quarter + , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy + , subq_5.booking__ds__day + , subq_5.booking__ds__week + , subq_5.booking__ds__month + , subq_5.booking__ds__quarter + , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy + , subq_5.booking__ds_partitioned__day + , subq_5.booking__ds_partitioned__week + , subq_5.booking__ds_partitioned__month + , subq_5.booking__ds_partitioned__quarter + , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy + , subq_5.booking__paid_at__day + , subq_5.booking__paid_at__week + , subq_5.booking__paid_at__month + , subq_5.booking__paid_at__quarter + , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy + , subq_5.ds__day AS metric_time__day + , subq_5.ds__week AS metric_time__week + , subq_5.ds__month AS metric_time__month + , subq_5.ds__quarter AS metric_time__quarter + , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy + , subq_5.listing + , subq_5.guest + , subq_5.host + , subq_5.booking__listing + , subq_5.booking__guest + , subq_5.booking__host + , subq_5.is_instant + , subq_5.booking__is_instant + , subq_5.bookings + , subq_5.instant_bookings + , subq_5.booking_value + , subq_5.max_booking_value + , subq_5.min_booking_value + , subq_5.bookers + , subq_5.average_booking_value + , subq_5.referred_bookings + , subq_5.median_booking_value + , subq_5.booking_value_p99 + , subq_5.discrete_booking_value_p99 + , subq_5.approximate_continuous_booking_value_p99 + , subq_5.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_5 + ) subq_6 + ON + DATE_SUB(CAST(subq_7.metric_time__day AS DATETIME), INTERVAL 14 day) = subq_6.metric_time__day + ) subq_9 + ) subq_10 + GROUP BY + metric_time__extract_dow + ) subq_11 + ) subq_12 + ON + ( + subq_4.metric_time__extract_dow = subq_12.metric_time__extract_dow + ) OR ( + ( + subq_4.metric_time__extract_dow IS NULL + ) AND ( + subq_12.metric_time__extract_dow IS NULL + ) + ) +) subq_13 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..3281174961 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_offset_window_with_date_part__plan0_optimized.sql @@ -0,0 +1,63 @@ +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_18.metric_time__extract_dow, subq_26.metric_time__extract_dow) AS metric_time__extract_dow + , subq_18.bookings AS bookings + , subq_26.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dayofweek FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_16 + GROUP BY + metric_time__extract_dow + ) subq_18 + INNER JOIN ( + -- Join to Time Spine Dataset + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + EXTRACT(dayofweek FROM subq_22.ds) AS metric_time__extract_dow + , SUM(subq_20.bookings) AS bookings_2_weeks_ago + FROM ***************************.mf_time_spine subq_22 + INNER JOIN ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + SELECT + ds AS metric_time__day + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_20 + ON + DATE_SUB(CAST(subq_22.ds AS DATETIME), INTERVAL 14 day) = subq_20.metric_time__day + GROUP BY + metric_time__extract_dow + ) subq_26 + ON + ( + subq_18.metric_time__extract_dow = subq_26.metric_time__extract_dow + ) OR ( + ( + subq_18.metric_time__extract_dow IS NULL + ) AND ( + subq_26.metric_time__extract_dow IS NULL + ) + ) +) subq_27 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql index 61c29db82f..34b763eb68 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_order_by_node__plan0.sql @@ -48,10 +48,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -60,10 +60,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -72,10 +72,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -85,10 +85,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -97,10 +97,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -109,10 +109,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql index 2fff30c78d..edb417b214 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_partitioned_join__plan0.sql @@ -109,10 +109,10 @@ FROM ( , EXTRACT(year FROM id_verifications_src_10003.ds) AS ds__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS ds__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS ds__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds) AS ds__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds) AS ds__extract_doy , id_verifications_src_10003.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS ds_partitioned__month @@ -121,10 +121,10 @@ FROM ( , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds_partitioned) AS ds_partitioned__extract_doy , id_verifications_src_10003.verification_type , id_verifications_src_10003.ds AS verification__ds__day , DATE_TRUNC(id_verifications_src_10003.ds, isoweek) AS verification__ds__week @@ -134,10 +134,10 @@ FROM ( , EXTRACT(year FROM id_verifications_src_10003.ds) AS verification__ds__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds) AS verification__ds__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds) AS verification__ds__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds) AS verification__ds__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds) AS verification__ds__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds) AS verification__ds__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds) AS verification__ds__extract_doy , id_verifications_src_10003.ds_partitioned AS verification__ds_partitioned__day , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, isoweek) AS verification__ds_partitioned__week , DATE_TRUNC(id_verifications_src_10003.ds_partitioned, month) AS verification__ds_partitioned__month @@ -146,10 +146,10 @@ FROM ( , EXTRACT(year FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_year , EXTRACT(quarter FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_quarter , EXTRACT(month FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week + , EXTRACT(isoweek FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_week , EXTRACT(day FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM id_verifications_src_10003.ds_partitioned) AS verification__ds_partitioned__extract_doy , id_verifications_src_10003.verification_type AS verification__verification_type , id_verifications_src_10003.verification_id AS verification , id_verifications_src_10003.user_id AS user @@ -176,10 +176,10 @@ FROM ( , EXTRACT(year FROM users_ds_source_src_10007.ds) AS ds__extract_year , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS ds__extract_quarter , EXTRACT(month FROM users_ds_source_src_10007.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_week + , EXTRACT(isoweek FROM users_ds_source_src_10007.ds) AS ds__extract_week , EXTRACT(day FROM users_ds_source_src_10007.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM users_ds_source_src_10007.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM users_ds_source_src_10007.ds) AS ds__extract_doy , users_ds_source_src_10007.created_at AS created_at__day , DATE_TRUNC(users_ds_source_src_10007.created_at, isoweek) AS created_at__week , DATE_TRUNC(users_ds_source_src_10007.created_at, month) AS created_at__month @@ -188,10 +188,10 @@ FROM ( , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS created_at__extract_year , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS created_at__extract_quarter , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM users_ds_source_src_10007.created_at) AS created_at__extract_week , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM users_ds_source_src_10007.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM users_ds_source_src_10007.created_at) AS created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, month) AS ds_partitioned__month @@ -200,10 +200,10 @@ FROM ( , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM users_ds_source_src_10007.ds_partitioned) AS ds_partitioned__extract_doy , users_ds_source_src_10007.home_state , users_ds_source_src_10007.ds AS user__ds__day , DATE_TRUNC(users_ds_source_src_10007.ds, isoweek) AS user__ds__week @@ -213,10 +213,10 @@ FROM ( , EXTRACT(year FROM users_ds_source_src_10007.ds) AS user__ds__extract_year , EXTRACT(quarter FROM users_ds_source_src_10007.ds) AS user__ds__extract_quarter , EXTRACT(month FROM users_ds_source_src_10007.ds) AS user__ds__extract_month - , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_week + , EXTRACT(isoweek FROM users_ds_source_src_10007.ds) AS user__ds__extract_week , EXTRACT(day FROM users_ds_source_src_10007.ds) AS user__ds__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy + , EXTRACT(dayofweek FROM users_ds_source_src_10007.ds) AS user__ds__extract_dow + , EXTRACT(dayofyear FROM users_ds_source_src_10007.ds) AS user__ds__extract_doy , users_ds_source_src_10007.created_at AS user__created_at__day , DATE_TRUNC(users_ds_source_src_10007.created_at, isoweek) AS user__created_at__week , DATE_TRUNC(users_ds_source_src_10007.created_at, month) AS user__created_at__month @@ -225,10 +225,10 @@ FROM ( , EXTRACT(year FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_year , EXTRACT(quarter FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_quarter , EXTRACT(month FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_month - , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week + , EXTRACT(isoweek FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_week , EXTRACT(day FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy + , EXTRACT(dayofweek FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_dow + , EXTRACT(dayofyear FROM users_ds_source_src_10007.created_at) AS user__created_at__extract_doy , users_ds_source_src_10007.ds_partitioned AS user__ds_partitioned__day , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, isoweek) AS user__ds_partitioned__week , DATE_TRUNC(users_ds_source_src_10007.ds_partitioned, month) AS user__ds_partitioned__month @@ -237,10 +237,10 @@ FROM ( , EXTRACT(year FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_year , EXTRACT(quarter FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_quarter , EXTRACT(month FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week + , EXTRACT(isoweek FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_week , EXTRACT(day FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM users_ds_source_src_10007.ds_partitioned) AS user__ds_partitioned__extract_doy , users_ds_source_src_10007.home_state AS user__home_state , users_ds_source_src_10007.user_id AS user FROM ***************************.dim_users users_ds_source_src_10007 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql index 791d0d4049..07e622e748 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0.sql @@ -45,10 +45,10 @@ FROM ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -85,10 +85,10 @@ INNER JOIN ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week @@ -98,10 +98,10 @@ INNER JOIN ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql index 0f94ea6726..060f3efacd 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node__plan0_optimized.sql @@ -45,10 +45,10 @@ FROM ( , EXTRACT(year FROM ds) AS ds__extract_year , EXTRACT(quarter FROM ds) AS ds__extract_quarter , EXTRACT(month FROM ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(isoweek FROM ds) AS ds__extract_week , EXTRACT(day FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM ds) AS account__ds__extract_year , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter , EXTRACT(month FROM ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM ds) AS account__ds__extract_week , EXTRACT(day FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql index 1e815dd2dc..f13236380c 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0.sql @@ -45,10 +45,10 @@ FROM ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -86,10 +86,10 @@ INNER JOIN ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week @@ -99,10 +99,10 @@ INNER JOIN ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql index a25638e888..8a36408f84 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_grouping__plan0_optimized.sql @@ -45,10 +45,10 @@ FROM ( , EXTRACT(year FROM ds) AS ds__extract_year , EXTRACT(quarter FROM ds) AS ds__extract_quarter , EXTRACT(month FROM ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(isoweek FROM ds) AS ds__extract_week , EXTRACT(day FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM ds) AS account__ds__extract_year , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter , EXTRACT(month FROM ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM ds) AS account__ds__extract_week , EXTRACT(day FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql index de371ca618..eff1adbdb9 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0.sql @@ -45,10 +45,10 @@ FROM ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user @@ -86,10 +86,10 @@ INNER JOIN ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS ds__extract_doy , accounts_source_src_10000.account_type , accounts_source_src_10000.ds AS account__ds__day , DATE_TRUNC(accounts_source_src_10000.ds, isoweek) AS account__ds__week @@ -99,10 +99,10 @@ INNER JOIN ( , EXTRACT(year FROM accounts_source_src_10000.ds) AS account__ds__extract_year , EXTRACT(quarter FROM accounts_source_src_10000.ds) AS account__ds__extract_quarter , EXTRACT(month FROM accounts_source_src_10000.ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM accounts_source_src_10000.ds) AS account__ds__extract_week , EXTRACT(day FROM accounts_source_src_10000.ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM accounts_source_src_10000.ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM accounts_source_src_10000.ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM accounts_source_src_10000.ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM accounts_source_src_10000.ds) AS account__ds__extract_doy , accounts_source_src_10000.account_type AS account__account_type , accounts_source_src_10000.user_id AS user , accounts_source_src_10000.user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql index 35af81c4d7..025caeebfc 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_semi_additive_join_node_with_queried_group_by__plan0_optimized.sql @@ -45,10 +45,10 @@ FROM ( , EXTRACT(year FROM ds) AS ds__extract_year , EXTRACT(quarter FROM ds) AS ds__extract_quarter , EXTRACT(month FROM ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(isoweek FROM ds) AS ds__extract_week , EXTRACT(day FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS ds__extract_doy , account_type , ds AS account__ds__day , DATE_TRUNC(ds, isoweek) AS account__ds__week @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM ds) AS account__ds__extract_year , EXTRACT(quarter FROM ds) AS account__ds__extract_quarter , EXTRACT(month FROM ds) AS account__ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS account__ds__extract_week + , EXTRACT(isoweek FROM ds) AS account__ds__extract_week , EXTRACT(day FROM ds) AS account__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS account__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS account__ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS account__ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS account__ds__extract_doy , account_type AS account__account_type , user_id AS user , user_id AS account__user diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0.sql new file mode 100644 index 0000000000..031517a99c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0.sql @@ -0,0 +1,227 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + metric_time__extract_dow +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..9ccede846b --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_date_part__plan0_optimized.sql @@ -0,0 +1,17 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dayofweek FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_dow diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0.sql new file mode 100644 index 0000000000..ec4e2ef1e8 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0.sql @@ -0,0 +1,258 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_year + , subq_3.metric_time__extract_quarter + , subq_3.metric_time__extract_month + , subq_3.metric_time__extract_week + , subq_3.metric_time__extract_day + , subq_3.metric_time__extract_dow + , subq_3.metric_time__extract_doy + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week + , DATE_TRUNC(bookings_source_src_10001.ds, month) AS booking__ds__month + , DATE_TRUNC(bookings_source_src_10001.ds, quarter) AS booking__ds__quarter + , DATE_TRUNC(bookings_source_src_10001.ds, year) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, quarter) AS booking__ds_partitioned__quarter + , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, year) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week + , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month + , DATE_TRUNC(bookings_source_src_10001.paid_at, quarter) AS booking__paid_at__quarter + , DATE_TRUNC(bookings_source_src_10001.paid_at, year) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0_optimized.sql new file mode 100644 index 0000000000..1d96b88869 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_simple_query_with_multiple_date_parts__plan0_optimized.sql @@ -0,0 +1,42 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(isoweek FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dayofweek FROM ds) AS metric_time__extract_dow + , EXTRACT(dayofyear FROM ds) AS metric_time__extract_doy + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql index 794337f673..e01a0418ff 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_single_join_node__plan0.sql @@ -34,10 +34,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -46,10 +46,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -58,10 +58,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -71,10 +71,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -83,10 +83,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -95,10 +95,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -128,10 +128,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS ds__extract_doy , listings_latest_src_10004.created_at AS created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS created_at__month @@ -140,10 +140,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS created_at__extract_doy , listings_latest_src_10004.country AS country_latest , listings_latest_src_10004.is_lux AS is_lux_latest , listings_latest_src_10004.capacity AS capacity_latest @@ -155,10 +155,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__ds__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__ds__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__ds__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__ds__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__ds__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__ds__extract_doy , listings_latest_src_10004.created_at AS listing__created_at__day , DATE_TRUNC(listings_latest_src_10004.created_at, isoweek) AS listing__created_at__week , DATE_TRUNC(listings_latest_src_10004.created_at, month) AS listing__created_at__month @@ -167,10 +167,10 @@ LEFT OUTER JOIN ( , EXTRACT(year FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_year , EXTRACT(quarter FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_quarter , EXTRACT(month FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_month - , EXTRACT(ISOWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week + , EXTRACT(isoweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_week , EXTRACT(day FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_day - , EXTRACT(DAYOFWEEK FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow - , EXTRACT(DAYOFYEAR FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy + , EXTRACT(dayofweek FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_dow + , EXTRACT(dayofyear FROM listings_latest_src_10004.created_at) AS listing__created_at__extract_doy , listings_latest_src_10004.country AS listing__country_latest , listings_latest_src_10004.is_lux AS listing__is_lux_latest , listings_latest_src_10004.capacity AS listing__capacity_latest diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql index 28daacf7ef..0ba3c40334 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0.sql @@ -23,10 +23,10 @@ SELECT , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -35,10 +35,10 @@ SELECT , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -47,10 +47,10 @@ SELECT , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -60,10 +60,10 @@ SELECT , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -72,10 +72,10 @@ SELECT , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -84,10 +84,10 @@ SELECT , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql index b6c163b9eb..3e49f05f72 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/BigQuery/test_source_node__plan0_optimized.sql @@ -23,10 +23,10 @@ SELECT , EXTRACT(year FROM ds) AS ds__extract_year , EXTRACT(quarter FROM ds) AS ds__extract_quarter , EXTRACT(month FROM ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(isoweek FROM ds) AS ds__extract_week , EXTRACT(day FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month @@ -35,10 +35,10 @@ SELECT , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month @@ -47,10 +47,10 @@ SELECT , EXTRACT(year FROM paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM paid_at) AS paid_at__extract_week , EXTRACT(day FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS paid_at__extract_doy , is_instant AS booking__is_instant , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week @@ -60,10 +60,10 @@ SELECT , EXTRACT(year FROM ds) AS booking__ds__extract_year , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter , EXTRACT(month FROM ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM ds) AS booking__ds__extract_week , EXTRACT(day FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month @@ -72,10 +72,10 @@ SELECT , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month @@ -84,10 +84,10 @@ SELECT , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS booking__paid_at__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql index d1740a6a39..79946c1bc1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_through_scd_dimension__plan0.sql @@ -381,25 +381,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', + -- 'ds__extract_year', + -- 'ds__extract_quarter', + -- 'ds__extract_month', + -- 'ds__extract_week', + -- 'ds__extract_day', + -- 'ds__extract_dow', + -- 'ds__extract_doy', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', + -- 'user__ds__extract_year', + -- 'user__ds__extract_quarter', + -- 'user__ds__extract_month', + -- 'user__ds__extract_week', + -- 'user__ds__extract_day', + -- 'user__ds__extract_dow', + -- 'user__ds__extract_doy', -- 'user'] SELECT subq_4.ds__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql index 8abc633b9a..1cfb7780a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multi_hop_to_scd_dimension__plan0.sql @@ -288,49 +288,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', + -- 'window_start__extract_year', + -- 'window_start__extract_quarter', + -- 'window_start__extract_month', + -- 'window_start__extract_week', + -- 'window_start__extract_day', + -- 'window_start__extract_dow', + -- 'window_start__extract_doy', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', + -- 'window_end__extract_year', + -- 'window_end__extract_quarter', + -- 'window_end__extract_month', + -- 'window_end__extract_week', + -- 'window_end__extract_day', + -- 'window_end__extract_dow', + -- 'window_end__extract_doy', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__extract_year', + -- 'lux_listing__window_start__extract_quarter', + -- 'lux_listing__window_start__extract_month', + -- 'lux_listing__window_start__extract_week', + -- 'lux_listing__window_start__extract_day', + -- 'lux_listing__window_start__extract_dow', + -- 'lux_listing__window_start__extract_doy', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__extract_year', + -- 'lux_listing__window_end__extract_quarter', + -- 'lux_listing__window_end__extract_month', + -- 'lux_listing__window_end__extract_week', + -- 'lux_listing__window_end__extract_day', + -- 'lux_listing__window_end__extract_dow', + -- 'lux_listing__window_end__extract_doy', -- 'lux_listing'] SELECT subq_4.window_start__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql index 99d4dba7cb..0d1825bde4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_multihop_node__plan0.sql @@ -252,25 +252,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', + -- 'ds_partitioned__extract_year', + -- 'ds_partitioned__extract_quarter', + -- 'ds_partitioned__extract_month', + -- 'ds_partitioned__extract_week', + -- 'ds_partitioned__extract_day', + -- 'ds_partitioned__extract_dow', + -- 'ds_partitioned__extract_doy', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__extract_year', + -- 'customer_id__ds_partitioned__extract_quarter', + -- 'customer_id__ds_partitioned__extract_month', + -- 'customer_id__ds_partitioned__extract_week', + -- 'customer_id__ds_partitioned__extract_day', + -- 'customer_id__ds_partitioned__extract_dow', + -- 'customer_id__ds_partitioned__extract_doy', -- 'customer_id'] SELECT subq_4.ds_partitioned__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql new file mode 100644 index 0000000000..68e1d3302c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0.sql @@ -0,0 +1,585 @@ +-- Compute Metrics via Expressions +SELECT + subq_13.metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_4.metric_time__extract_dow, subq_12.metric_time__extract_dow) AS metric_time__extract_dow + , subq_4.bookings AS bookings + , subq_12.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Compute Metrics via Expressions + SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings + FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow + ) subq_3 + ) subq_4 + INNER JOIN ( + -- Compute Metrics via Expressions + SELECT + subq_11.metric_time__extract_dow + , subq_11.bookings AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + SELECT + subq_10.metric_time__extract_dow + , SUM(subq_10.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_9.metric_time__extract_dow + , subq_9.bookings + FROM ( + -- Join to Time Spine Dataset + SELECT + EXTRACT(dow FROM subq_7.metric_time__day) AS metric_time__extract_dow + , subq_6.ds__day AS ds__day + , subq_6.ds__week AS ds__week + , subq_6.ds__month AS ds__month + , subq_6.ds__quarter AS ds__quarter + , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy + , subq_6.ds_partitioned__day AS ds_partitioned__day + , subq_6.ds_partitioned__week AS ds_partitioned__week + , subq_6.ds_partitioned__month AS ds_partitioned__month + , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter + , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy + , subq_6.paid_at__day AS paid_at__day + , subq_6.paid_at__week AS paid_at__week + , subq_6.paid_at__month AS paid_at__month + , subq_6.paid_at__quarter AS paid_at__quarter + , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__day AS booking__ds__day + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy + , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day + , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week + , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month + , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter + , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy + , subq_6.booking__paid_at__day AS booking__paid_at__day + , subq_6.booking__paid_at__week AS booking__paid_at__week + , subq_6.booking__paid_at__month AS booking__paid_at__month + , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter + , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.listing AS listing + , subq_6.guest AS guest + , subq_6.host AS host + , subq_6.booking__listing AS booking__listing + , subq_6.booking__guest AS booking__guest + , subq_6.booking__host AS booking__host + , subq_6.is_instant AS is_instant + , subq_6.booking__is_instant AS booking__is_instant + , subq_6.bookings AS bookings + , subq_6.instant_bookings AS instant_bookings + , subq_6.booking_value AS booking_value + , subq_6.max_booking_value AS max_booking_value + , subq_6.min_booking_value AS min_booking_value + , subq_6.bookers AS bookers + , subq_6.average_booking_value AS average_booking_value + , subq_6.referred_bookings AS referred_bookings + , subq_6.median_booking_value AS median_booking_value + , subq_6.booking_value_p99 AS booking_value_p99 + , subq_6.discrete_booking_value_p99 AS discrete_booking_value_p99 + , subq_6.approximate_continuous_booking_value_p99 AS approximate_continuous_booking_value_p99 + , subq_6.approximate_discrete_booking_value_p99 AS approximate_discrete_booking_value_p99 + FROM ( + -- Date Spine + SELECT + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + ) subq_7 + INNER JOIN ( + -- Metric Time Dimension 'ds' + SELECT + subq_5.ds__day + , subq_5.ds__week + , subq_5.ds__month + , subq_5.ds__quarter + , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy + , subq_5.ds_partitioned__day + , subq_5.ds_partitioned__week + , subq_5.ds_partitioned__month + , subq_5.ds_partitioned__quarter + , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy + , subq_5.paid_at__day + , subq_5.paid_at__week + , subq_5.paid_at__month + , subq_5.paid_at__quarter + , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy + , subq_5.booking__ds__day + , subq_5.booking__ds__week + , subq_5.booking__ds__month + , subq_5.booking__ds__quarter + , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy + , subq_5.booking__ds_partitioned__day + , subq_5.booking__ds_partitioned__week + , subq_5.booking__ds_partitioned__month + , subq_5.booking__ds_partitioned__quarter + , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy + , subq_5.booking__paid_at__day + , subq_5.booking__paid_at__week + , subq_5.booking__paid_at__month + , subq_5.booking__paid_at__quarter + , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy + , subq_5.ds__day AS metric_time__day + , subq_5.ds__week AS metric_time__week + , subq_5.ds__month AS metric_time__month + , subq_5.ds__quarter AS metric_time__quarter + , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy + , subq_5.listing + , subq_5.guest + , subq_5.host + , subq_5.booking__listing + , subq_5.booking__guest + , subq_5.booking__host + , subq_5.is_instant + , subq_5.booking__is_instant + , subq_5.bookings + , subq_5.instant_bookings + , subq_5.booking_value + , subq_5.max_booking_value + , subq_5.min_booking_value + , subq_5.bookers + , subq_5.average_booking_value + , subq_5.referred_bookings + , subq_5.median_booking_value + , subq_5.booking_value_p99 + , subq_5.discrete_booking_value_p99 + , subq_5.approximate_continuous_booking_value_p99 + , subq_5.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_5 + ) subq_6 + ON + DATEADD(day, -14, subq_7.metric_time__day) = subq_6.metric_time__day + ) subq_9 + ) subq_10 + GROUP BY + subq_10.metric_time__extract_dow + ) subq_11 + ) subq_12 + ON + ( + subq_4.metric_time__extract_dow = subq_12.metric_time__extract_dow + ) OR ( + ( + subq_4.metric_time__extract_dow IS NULL + ) AND ( + subq_12.metric_time__extract_dow IS NULL + ) + ) +) subq_13 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..d1a408e031 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_offset_window_with_date_part__plan0_optimized.sql @@ -0,0 +1,63 @@ +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_18.metric_time__extract_dow, subq_26.metric_time__extract_dow) AS metric_time__extract_dow + , subq_18.bookings AS bookings + , subq_26.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_16 + GROUP BY + metric_time__extract_dow + ) subq_18 + INNER JOIN ( + -- Join to Time Spine Dataset + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + EXTRACT(dow FROM subq_22.ds) AS metric_time__extract_dow + , SUM(subq_20.bookings) AS bookings_2_weeks_ago + FROM ***************************.mf_time_spine subq_22 + INNER JOIN ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + SELECT + ds AS metric_time__day + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_20 + ON + DATEADD(day, -14, subq_22.ds) = subq_20.metric_time__day + GROUP BY + EXTRACT(dow FROM subq_22.ds) + ) subq_26 + ON + ( + subq_18.metric_time__extract_dow = subq_26.metric_time__extract_dow + ) OR ( + ( + subq_18.metric_time__extract_dow IS NULL + ) AND ( + subq_26.metric_time__extract_dow IS NULL + ) + ) +) subq_27 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0.sql new file mode 100644 index 0000000000..3869c341c5 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0.sql @@ -0,0 +1,227 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..33b25a725c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_date_part__plan0_optimized.sql @@ -0,0 +1,17 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_dow diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0.sql new file mode 100644 index 0000000000..b1321ec748 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0.sql @@ -0,0 +1,258 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_year + , subq_3.metric_time__extract_quarter + , subq_3.metric_time__extract_month + , subq_3.metric_time__extract_week + , subq_3.metric_time__extract_day + , subq_3.metric_time__extract_dow + , subq_3.metric_time__extract_doy + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0_optimized.sql new file mode 100644 index 0000000000..402fb4f517 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Databricks/test_simple_query_with_multiple_date_parts__plan0_optimized.sql @@ -0,0 +1,42 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql index d1740a6a39..79946c1bc1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_through_scd_dimension__plan0.sql @@ -381,25 +381,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', + -- 'ds__extract_year', + -- 'ds__extract_quarter', + -- 'ds__extract_month', + -- 'ds__extract_week', + -- 'ds__extract_day', + -- 'ds__extract_dow', + -- 'ds__extract_doy', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', + -- 'user__ds__extract_year', + -- 'user__ds__extract_quarter', + -- 'user__ds__extract_month', + -- 'user__ds__extract_week', + -- 'user__ds__extract_day', + -- 'user__ds__extract_dow', + -- 'user__ds__extract_doy', -- 'user'] SELECT subq_4.ds__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql index 8abc633b9a..1cfb7780a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multi_hop_to_scd_dimension__plan0.sql @@ -288,49 +288,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', + -- 'window_start__extract_year', + -- 'window_start__extract_quarter', + -- 'window_start__extract_month', + -- 'window_start__extract_week', + -- 'window_start__extract_day', + -- 'window_start__extract_dow', + -- 'window_start__extract_doy', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', + -- 'window_end__extract_year', + -- 'window_end__extract_quarter', + -- 'window_end__extract_month', + -- 'window_end__extract_week', + -- 'window_end__extract_day', + -- 'window_end__extract_dow', + -- 'window_end__extract_doy', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__extract_year', + -- 'lux_listing__window_start__extract_quarter', + -- 'lux_listing__window_start__extract_month', + -- 'lux_listing__window_start__extract_week', + -- 'lux_listing__window_start__extract_day', + -- 'lux_listing__window_start__extract_dow', + -- 'lux_listing__window_start__extract_doy', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__extract_year', + -- 'lux_listing__window_end__extract_quarter', + -- 'lux_listing__window_end__extract_month', + -- 'lux_listing__window_end__extract_week', + -- 'lux_listing__window_end__extract_day', + -- 'lux_listing__window_end__extract_dow', + -- 'lux_listing__window_end__extract_doy', -- 'lux_listing'] SELECT subq_4.window_start__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql index 99d4dba7cb..0d1825bde4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_multihop_node__plan0.sql @@ -252,25 +252,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', + -- 'ds_partitioned__extract_year', + -- 'ds_partitioned__extract_quarter', + -- 'ds_partitioned__extract_month', + -- 'ds_partitioned__extract_week', + -- 'ds_partitioned__extract_day', + -- 'ds_partitioned__extract_dow', + -- 'ds_partitioned__extract_doy', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__extract_year', + -- 'customer_id__ds_partitioned__extract_quarter', + -- 'customer_id__ds_partitioned__extract_month', + -- 'customer_id__ds_partitioned__extract_week', + -- 'customer_id__ds_partitioned__extract_day', + -- 'customer_id__ds_partitioned__extract_dow', + -- 'customer_id__ds_partitioned__extract_doy', -- 'customer_id'] SELECT subq_4.ds_partitioned__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql new file mode 100644 index 0000000000..a65895e8b1 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0.sql @@ -0,0 +1,585 @@ +-- Compute Metrics via Expressions +SELECT + subq_13.metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_4.metric_time__extract_dow, subq_12.metric_time__extract_dow) AS metric_time__extract_dow + , subq_4.bookings AS bookings + , subq_12.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Compute Metrics via Expressions + SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings + FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow + ) subq_3 + ) subq_4 + INNER JOIN ( + -- Compute Metrics via Expressions + SELECT + subq_11.metric_time__extract_dow + , subq_11.bookings AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + SELECT + subq_10.metric_time__extract_dow + , SUM(subq_10.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_9.metric_time__extract_dow + , subq_9.bookings + FROM ( + -- Join to Time Spine Dataset + SELECT + EXTRACT(dow FROM subq_7.metric_time__day) AS metric_time__extract_dow + , subq_6.ds__day AS ds__day + , subq_6.ds__week AS ds__week + , subq_6.ds__month AS ds__month + , subq_6.ds__quarter AS ds__quarter + , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy + , subq_6.ds_partitioned__day AS ds_partitioned__day + , subq_6.ds_partitioned__week AS ds_partitioned__week + , subq_6.ds_partitioned__month AS ds_partitioned__month + , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter + , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy + , subq_6.paid_at__day AS paid_at__day + , subq_6.paid_at__week AS paid_at__week + , subq_6.paid_at__month AS paid_at__month + , subq_6.paid_at__quarter AS paid_at__quarter + , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__day AS booking__ds__day + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy + , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day + , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week + , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month + , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter + , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy + , subq_6.booking__paid_at__day AS booking__paid_at__day + , subq_6.booking__paid_at__week AS booking__paid_at__week + , subq_6.booking__paid_at__month AS booking__paid_at__month + , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter + , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.listing AS listing + , subq_6.guest AS guest + , subq_6.host AS host + , subq_6.booking__listing AS booking__listing + , subq_6.booking__guest AS booking__guest + , subq_6.booking__host AS booking__host + , subq_6.is_instant AS is_instant + , subq_6.booking__is_instant AS booking__is_instant + , subq_6.bookings AS bookings + , subq_6.instant_bookings AS instant_bookings + , subq_6.booking_value AS booking_value + , subq_6.max_booking_value AS max_booking_value + , subq_6.min_booking_value AS min_booking_value + , subq_6.bookers AS bookers + , subq_6.average_booking_value AS average_booking_value + , subq_6.referred_bookings AS referred_bookings + , subq_6.median_booking_value AS median_booking_value + , subq_6.booking_value_p99 AS booking_value_p99 + , subq_6.discrete_booking_value_p99 AS discrete_booking_value_p99 + , subq_6.approximate_continuous_booking_value_p99 AS approximate_continuous_booking_value_p99 + , subq_6.approximate_discrete_booking_value_p99 AS approximate_discrete_booking_value_p99 + FROM ( + -- Date Spine + SELECT + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + ) subq_7 + INNER JOIN ( + -- Metric Time Dimension 'ds' + SELECT + subq_5.ds__day + , subq_5.ds__week + , subq_5.ds__month + , subq_5.ds__quarter + , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy + , subq_5.ds_partitioned__day + , subq_5.ds_partitioned__week + , subq_5.ds_partitioned__month + , subq_5.ds_partitioned__quarter + , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy + , subq_5.paid_at__day + , subq_5.paid_at__week + , subq_5.paid_at__month + , subq_5.paid_at__quarter + , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy + , subq_5.booking__ds__day + , subq_5.booking__ds__week + , subq_5.booking__ds__month + , subq_5.booking__ds__quarter + , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy + , subq_5.booking__ds_partitioned__day + , subq_5.booking__ds_partitioned__week + , subq_5.booking__ds_partitioned__month + , subq_5.booking__ds_partitioned__quarter + , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy + , subq_5.booking__paid_at__day + , subq_5.booking__paid_at__week + , subq_5.booking__paid_at__month + , subq_5.booking__paid_at__quarter + , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy + , subq_5.ds__day AS metric_time__day + , subq_5.ds__week AS metric_time__week + , subq_5.ds__month AS metric_time__month + , subq_5.ds__quarter AS metric_time__quarter + , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy + , subq_5.listing + , subq_5.guest + , subq_5.host + , subq_5.booking__listing + , subq_5.booking__guest + , subq_5.booking__host + , subq_5.is_instant + , subq_5.booking__is_instant + , subq_5.bookings + , subq_5.instant_bookings + , subq_5.booking_value + , subq_5.max_booking_value + , subq_5.min_booking_value + , subq_5.bookers + , subq_5.average_booking_value + , subq_5.referred_bookings + , subq_5.median_booking_value + , subq_5.booking_value_p99 + , subq_5.discrete_booking_value_p99 + , subq_5.approximate_continuous_booking_value_p99 + , subq_5.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_5 + ) subq_6 + ON + subq_7.metric_time__day - INTERVAL 14 day = subq_6.metric_time__day + ) subq_9 + ) subq_10 + GROUP BY + subq_10.metric_time__extract_dow + ) subq_11 + ) subq_12 + ON + ( + subq_4.metric_time__extract_dow = subq_12.metric_time__extract_dow + ) OR ( + ( + subq_4.metric_time__extract_dow IS NULL + ) AND ( + subq_12.metric_time__extract_dow IS NULL + ) + ) +) subq_13 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..5f6ec1ee79 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_offset_window_with_date_part__plan0_optimized.sql @@ -0,0 +1,63 @@ +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_18.metric_time__extract_dow, subq_26.metric_time__extract_dow) AS metric_time__extract_dow + , subq_18.bookings AS bookings + , subq_26.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_16 + GROUP BY + metric_time__extract_dow + ) subq_18 + INNER JOIN ( + -- Join to Time Spine Dataset + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + EXTRACT(dow FROM subq_22.ds) AS metric_time__extract_dow + , SUM(subq_20.bookings) AS bookings_2_weeks_ago + FROM ***************************.mf_time_spine subq_22 + INNER JOIN ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + SELECT + ds AS metric_time__day + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_20 + ON + subq_22.ds - INTERVAL 14 day = subq_20.metric_time__day + GROUP BY + EXTRACT(dow FROM subq_22.ds) + ) subq_26 + ON + ( + subq_18.metric_time__extract_dow = subq_26.metric_time__extract_dow + ) OR ( + ( + subq_18.metric_time__extract_dow IS NULL + ) AND ( + subq_26.metric_time__extract_dow IS NULL + ) + ) +) subq_27 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0.sql new file mode 100644 index 0000000000..3869c341c5 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0.sql @@ -0,0 +1,227 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..33b25a725c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_date_part__plan0_optimized.sql @@ -0,0 +1,17 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_dow diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0.sql new file mode 100644 index 0000000000..b1321ec748 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0.sql @@ -0,0 +1,258 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_year + , subq_3.metric_time__extract_quarter + , subq_3.metric_time__extract_month + , subq_3.metric_time__extract_week + , subq_3.metric_time__extract_day + , subq_3.metric_time__extract_dow + , subq_3.metric_time__extract_doy + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0_optimized.sql new file mode 100644 index 0000000000..402fb4f517 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/DuckDB/test_simple_query_with_multiple_date_parts__plan0_optimized.sql @@ -0,0 +1,42 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql index d1740a6a39..79946c1bc1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_through_scd_dimension__plan0.sql @@ -381,25 +381,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', + -- 'ds__extract_year', + -- 'ds__extract_quarter', + -- 'ds__extract_month', + -- 'ds__extract_week', + -- 'ds__extract_day', + -- 'ds__extract_dow', + -- 'ds__extract_doy', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', + -- 'user__ds__extract_year', + -- 'user__ds__extract_quarter', + -- 'user__ds__extract_month', + -- 'user__ds__extract_week', + -- 'user__ds__extract_day', + -- 'user__ds__extract_dow', + -- 'user__ds__extract_doy', -- 'user'] SELECT subq_4.ds__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql index 8abc633b9a..1cfb7780a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multi_hop_to_scd_dimension__plan0.sql @@ -288,49 +288,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', + -- 'window_start__extract_year', + -- 'window_start__extract_quarter', + -- 'window_start__extract_month', + -- 'window_start__extract_week', + -- 'window_start__extract_day', + -- 'window_start__extract_dow', + -- 'window_start__extract_doy', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', + -- 'window_end__extract_year', + -- 'window_end__extract_quarter', + -- 'window_end__extract_month', + -- 'window_end__extract_week', + -- 'window_end__extract_day', + -- 'window_end__extract_dow', + -- 'window_end__extract_doy', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__extract_year', + -- 'lux_listing__window_start__extract_quarter', + -- 'lux_listing__window_start__extract_month', + -- 'lux_listing__window_start__extract_week', + -- 'lux_listing__window_start__extract_day', + -- 'lux_listing__window_start__extract_dow', + -- 'lux_listing__window_start__extract_doy', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__extract_year', + -- 'lux_listing__window_end__extract_quarter', + -- 'lux_listing__window_end__extract_month', + -- 'lux_listing__window_end__extract_week', + -- 'lux_listing__window_end__extract_day', + -- 'lux_listing__window_end__extract_dow', + -- 'lux_listing__window_end__extract_doy', -- 'lux_listing'] SELECT subq_4.window_start__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql index 99d4dba7cb..0d1825bde4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_multihop_node__plan0.sql @@ -252,25 +252,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', + -- 'ds_partitioned__extract_year', + -- 'ds_partitioned__extract_quarter', + -- 'ds_partitioned__extract_month', + -- 'ds_partitioned__extract_week', + -- 'ds_partitioned__extract_day', + -- 'ds_partitioned__extract_dow', + -- 'ds_partitioned__extract_doy', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__extract_year', + -- 'customer_id__ds_partitioned__extract_quarter', + -- 'customer_id__ds_partitioned__extract_month', + -- 'customer_id__ds_partitioned__extract_week', + -- 'customer_id__ds_partitioned__extract_day', + -- 'customer_id__ds_partitioned__extract_dow', + -- 'customer_id__ds_partitioned__extract_doy', -- 'customer_id'] SELECT subq_4.ds_partitioned__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql new file mode 100644 index 0000000000..17b1104b28 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0.sql @@ -0,0 +1,585 @@ +-- Compute Metrics via Expressions +SELECT + subq_13.metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_4.metric_time__extract_dow, subq_12.metric_time__extract_dow) AS metric_time__extract_dow + , subq_4.bookings AS bookings + , subq_12.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Compute Metrics via Expressions + SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings + FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow + ) subq_3 + ) subq_4 + INNER JOIN ( + -- Compute Metrics via Expressions + SELECT + subq_11.metric_time__extract_dow + , subq_11.bookings AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + SELECT + subq_10.metric_time__extract_dow + , SUM(subq_10.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_9.metric_time__extract_dow + , subq_9.bookings + FROM ( + -- Join to Time Spine Dataset + SELECT + EXTRACT(dow FROM subq_7.metric_time__day) AS metric_time__extract_dow + , subq_6.ds__day AS ds__day + , subq_6.ds__week AS ds__week + , subq_6.ds__month AS ds__month + , subq_6.ds__quarter AS ds__quarter + , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy + , subq_6.ds_partitioned__day AS ds_partitioned__day + , subq_6.ds_partitioned__week AS ds_partitioned__week + , subq_6.ds_partitioned__month AS ds_partitioned__month + , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter + , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy + , subq_6.paid_at__day AS paid_at__day + , subq_6.paid_at__week AS paid_at__week + , subq_6.paid_at__month AS paid_at__month + , subq_6.paid_at__quarter AS paid_at__quarter + , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__day AS booking__ds__day + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy + , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day + , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week + , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month + , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter + , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy + , subq_6.booking__paid_at__day AS booking__paid_at__day + , subq_6.booking__paid_at__week AS booking__paid_at__week + , subq_6.booking__paid_at__month AS booking__paid_at__month + , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter + , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.listing AS listing + , subq_6.guest AS guest + , subq_6.host AS host + , subq_6.booking__listing AS booking__listing + , subq_6.booking__guest AS booking__guest + , subq_6.booking__host AS booking__host + , subq_6.is_instant AS is_instant + , subq_6.booking__is_instant AS booking__is_instant + , subq_6.bookings AS bookings + , subq_6.instant_bookings AS instant_bookings + , subq_6.booking_value AS booking_value + , subq_6.max_booking_value AS max_booking_value + , subq_6.min_booking_value AS min_booking_value + , subq_6.bookers AS bookers + , subq_6.average_booking_value AS average_booking_value + , subq_6.referred_bookings AS referred_bookings + , subq_6.median_booking_value AS median_booking_value + , subq_6.booking_value_p99 AS booking_value_p99 + , subq_6.discrete_booking_value_p99 AS discrete_booking_value_p99 + , subq_6.approximate_continuous_booking_value_p99 AS approximate_continuous_booking_value_p99 + , subq_6.approximate_discrete_booking_value_p99 AS approximate_discrete_booking_value_p99 + FROM ( + -- Date Spine + SELECT + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + ) subq_7 + INNER JOIN ( + -- Metric Time Dimension 'ds' + SELECT + subq_5.ds__day + , subq_5.ds__week + , subq_5.ds__month + , subq_5.ds__quarter + , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy + , subq_5.ds_partitioned__day + , subq_5.ds_partitioned__week + , subq_5.ds_partitioned__month + , subq_5.ds_partitioned__quarter + , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy + , subq_5.paid_at__day + , subq_5.paid_at__week + , subq_5.paid_at__month + , subq_5.paid_at__quarter + , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy + , subq_5.booking__ds__day + , subq_5.booking__ds__week + , subq_5.booking__ds__month + , subq_5.booking__ds__quarter + , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy + , subq_5.booking__ds_partitioned__day + , subq_5.booking__ds_partitioned__week + , subq_5.booking__ds_partitioned__month + , subq_5.booking__ds_partitioned__quarter + , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy + , subq_5.booking__paid_at__day + , subq_5.booking__paid_at__week + , subq_5.booking__paid_at__month + , subq_5.booking__paid_at__quarter + , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy + , subq_5.ds__day AS metric_time__day + , subq_5.ds__week AS metric_time__week + , subq_5.ds__month AS metric_time__month + , subq_5.ds__quarter AS metric_time__quarter + , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy + , subq_5.listing + , subq_5.guest + , subq_5.host + , subq_5.booking__listing + , subq_5.booking__guest + , subq_5.booking__host + , subq_5.is_instant + , subq_5.booking__is_instant + , subq_5.bookings + , subq_5.instant_bookings + , subq_5.booking_value + , subq_5.max_booking_value + , subq_5.min_booking_value + , subq_5.bookers + , subq_5.average_booking_value + , subq_5.referred_bookings + , subq_5.median_booking_value + , subq_5.booking_value_p99 + , subq_5.discrete_booking_value_p99 + , subq_5.approximate_continuous_booking_value_p99 + , subq_5.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_5 + ) subq_6 + ON + subq_7.metric_time__day - MAKE_INTERVAL(days => 14) = subq_6.metric_time__day + ) subq_9 + ) subq_10 + GROUP BY + subq_10.metric_time__extract_dow + ) subq_11 + ) subq_12 + ON + ( + subq_4.metric_time__extract_dow = subq_12.metric_time__extract_dow + ) OR ( + ( + subq_4.metric_time__extract_dow IS NULL + ) AND ( + subq_12.metric_time__extract_dow IS NULL + ) + ) +) subq_13 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..0ddba9f210 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_offset_window_with_date_part__plan0_optimized.sql @@ -0,0 +1,63 @@ +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_18.metric_time__extract_dow, subq_26.metric_time__extract_dow) AS metric_time__extract_dow + , subq_18.bookings AS bookings + , subq_26.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_16 + GROUP BY + metric_time__extract_dow + ) subq_18 + INNER JOIN ( + -- Join to Time Spine Dataset + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + EXTRACT(dow FROM subq_22.ds) AS metric_time__extract_dow + , SUM(subq_20.bookings) AS bookings_2_weeks_ago + FROM ***************************.mf_time_spine subq_22 + INNER JOIN ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + SELECT + ds AS metric_time__day + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_20 + ON + subq_22.ds - MAKE_INTERVAL(days => 14) = subq_20.metric_time__day + GROUP BY + EXTRACT(dow FROM subq_22.ds) + ) subq_26 + ON + ( + subq_18.metric_time__extract_dow = subq_26.metric_time__extract_dow + ) OR ( + ( + subq_18.metric_time__extract_dow IS NULL + ) AND ( + subq_26.metric_time__extract_dow IS NULL + ) + ) +) subq_27 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0.sql new file mode 100644 index 0000000000..3869c341c5 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0.sql @@ -0,0 +1,227 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..33b25a725c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_date_part__plan0_optimized.sql @@ -0,0 +1,17 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_dow diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0.sql new file mode 100644 index 0000000000..b1321ec748 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0.sql @@ -0,0 +1,258 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_year + , subq_3.metric_time__extract_quarter + , subq_3.metric_time__extract_month + , subq_3.metric_time__extract_week + , subq_3.metric_time__extract_day + , subq_3.metric_time__extract_dow + , subq_3.metric_time__extract_doy + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0_optimized.sql new file mode 100644 index 0000000000..402fb4f517 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Postgres/test_simple_query_with_multiple_date_parts__plan0_optimized.sql @@ -0,0 +1,42 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql index d1740a6a39..79946c1bc1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_through_scd_dimension__plan0.sql @@ -381,25 +381,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', + -- 'ds__extract_year', + -- 'ds__extract_quarter', + -- 'ds__extract_month', + -- 'ds__extract_week', + -- 'ds__extract_day', + -- 'ds__extract_dow', + -- 'ds__extract_doy', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', + -- 'user__ds__extract_year', + -- 'user__ds__extract_quarter', + -- 'user__ds__extract_month', + -- 'user__ds__extract_week', + -- 'user__ds__extract_day', + -- 'user__ds__extract_dow', + -- 'user__ds__extract_doy', -- 'user'] SELECT subq_4.ds__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql index 8abc633b9a..1cfb7780a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multi_hop_to_scd_dimension__plan0.sql @@ -288,49 +288,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', + -- 'window_start__extract_year', + -- 'window_start__extract_quarter', + -- 'window_start__extract_month', + -- 'window_start__extract_week', + -- 'window_start__extract_day', + -- 'window_start__extract_dow', + -- 'window_start__extract_doy', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', + -- 'window_end__extract_year', + -- 'window_end__extract_quarter', + -- 'window_end__extract_month', + -- 'window_end__extract_week', + -- 'window_end__extract_day', + -- 'window_end__extract_dow', + -- 'window_end__extract_doy', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__extract_year', + -- 'lux_listing__window_start__extract_quarter', + -- 'lux_listing__window_start__extract_month', + -- 'lux_listing__window_start__extract_week', + -- 'lux_listing__window_start__extract_day', + -- 'lux_listing__window_start__extract_dow', + -- 'lux_listing__window_start__extract_doy', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__extract_year', + -- 'lux_listing__window_end__extract_quarter', + -- 'lux_listing__window_end__extract_month', + -- 'lux_listing__window_end__extract_week', + -- 'lux_listing__window_end__extract_day', + -- 'lux_listing__window_end__extract_dow', + -- 'lux_listing__window_end__extract_doy', -- 'lux_listing'] SELECT subq_4.window_start__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql index 99d4dba7cb..0d1825bde4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_multihop_node__plan0.sql @@ -252,25 +252,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', + -- 'ds_partitioned__extract_year', + -- 'ds_partitioned__extract_quarter', + -- 'ds_partitioned__extract_month', + -- 'ds_partitioned__extract_week', + -- 'ds_partitioned__extract_day', + -- 'ds_partitioned__extract_dow', + -- 'ds_partitioned__extract_doy', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__extract_year', + -- 'customer_id__ds_partitioned__extract_quarter', + -- 'customer_id__ds_partitioned__extract_month', + -- 'customer_id__ds_partitioned__extract_week', + -- 'customer_id__ds_partitioned__extract_day', + -- 'customer_id__ds_partitioned__extract_dow', + -- 'customer_id__ds_partitioned__extract_doy', -- 'customer_id'] SELECT subq_4.ds_partitioned__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql new file mode 100644 index 0000000000..68e1d3302c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0.sql @@ -0,0 +1,585 @@ +-- Compute Metrics via Expressions +SELECT + subq_13.metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_4.metric_time__extract_dow, subq_12.metric_time__extract_dow) AS metric_time__extract_dow + , subq_4.bookings AS bookings + , subq_12.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Compute Metrics via Expressions + SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings + FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow + ) subq_3 + ) subq_4 + INNER JOIN ( + -- Compute Metrics via Expressions + SELECT + subq_11.metric_time__extract_dow + , subq_11.bookings AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + SELECT + subq_10.metric_time__extract_dow + , SUM(subq_10.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_9.metric_time__extract_dow + , subq_9.bookings + FROM ( + -- Join to Time Spine Dataset + SELECT + EXTRACT(dow FROM subq_7.metric_time__day) AS metric_time__extract_dow + , subq_6.ds__day AS ds__day + , subq_6.ds__week AS ds__week + , subq_6.ds__month AS ds__month + , subq_6.ds__quarter AS ds__quarter + , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy + , subq_6.ds_partitioned__day AS ds_partitioned__day + , subq_6.ds_partitioned__week AS ds_partitioned__week + , subq_6.ds_partitioned__month AS ds_partitioned__month + , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter + , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy + , subq_6.paid_at__day AS paid_at__day + , subq_6.paid_at__week AS paid_at__week + , subq_6.paid_at__month AS paid_at__month + , subq_6.paid_at__quarter AS paid_at__quarter + , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__day AS booking__ds__day + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy + , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day + , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week + , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month + , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter + , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy + , subq_6.booking__paid_at__day AS booking__paid_at__day + , subq_6.booking__paid_at__week AS booking__paid_at__week + , subq_6.booking__paid_at__month AS booking__paid_at__month + , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter + , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.listing AS listing + , subq_6.guest AS guest + , subq_6.host AS host + , subq_6.booking__listing AS booking__listing + , subq_6.booking__guest AS booking__guest + , subq_6.booking__host AS booking__host + , subq_6.is_instant AS is_instant + , subq_6.booking__is_instant AS booking__is_instant + , subq_6.bookings AS bookings + , subq_6.instant_bookings AS instant_bookings + , subq_6.booking_value AS booking_value + , subq_6.max_booking_value AS max_booking_value + , subq_6.min_booking_value AS min_booking_value + , subq_6.bookers AS bookers + , subq_6.average_booking_value AS average_booking_value + , subq_6.referred_bookings AS referred_bookings + , subq_6.median_booking_value AS median_booking_value + , subq_6.booking_value_p99 AS booking_value_p99 + , subq_6.discrete_booking_value_p99 AS discrete_booking_value_p99 + , subq_6.approximate_continuous_booking_value_p99 AS approximate_continuous_booking_value_p99 + , subq_6.approximate_discrete_booking_value_p99 AS approximate_discrete_booking_value_p99 + FROM ( + -- Date Spine + SELECT + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + ) subq_7 + INNER JOIN ( + -- Metric Time Dimension 'ds' + SELECT + subq_5.ds__day + , subq_5.ds__week + , subq_5.ds__month + , subq_5.ds__quarter + , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy + , subq_5.ds_partitioned__day + , subq_5.ds_partitioned__week + , subq_5.ds_partitioned__month + , subq_5.ds_partitioned__quarter + , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy + , subq_5.paid_at__day + , subq_5.paid_at__week + , subq_5.paid_at__month + , subq_5.paid_at__quarter + , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy + , subq_5.booking__ds__day + , subq_5.booking__ds__week + , subq_5.booking__ds__month + , subq_5.booking__ds__quarter + , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy + , subq_5.booking__ds_partitioned__day + , subq_5.booking__ds_partitioned__week + , subq_5.booking__ds_partitioned__month + , subq_5.booking__ds_partitioned__quarter + , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy + , subq_5.booking__paid_at__day + , subq_5.booking__paid_at__week + , subq_5.booking__paid_at__month + , subq_5.booking__paid_at__quarter + , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy + , subq_5.ds__day AS metric_time__day + , subq_5.ds__week AS metric_time__week + , subq_5.ds__month AS metric_time__month + , subq_5.ds__quarter AS metric_time__quarter + , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy + , subq_5.listing + , subq_5.guest + , subq_5.host + , subq_5.booking__listing + , subq_5.booking__guest + , subq_5.booking__host + , subq_5.is_instant + , subq_5.booking__is_instant + , subq_5.bookings + , subq_5.instant_bookings + , subq_5.booking_value + , subq_5.max_booking_value + , subq_5.min_booking_value + , subq_5.bookers + , subq_5.average_booking_value + , subq_5.referred_bookings + , subq_5.median_booking_value + , subq_5.booking_value_p99 + , subq_5.discrete_booking_value_p99 + , subq_5.approximate_continuous_booking_value_p99 + , subq_5.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_5 + ) subq_6 + ON + DATEADD(day, -14, subq_7.metric_time__day) = subq_6.metric_time__day + ) subq_9 + ) subq_10 + GROUP BY + subq_10.metric_time__extract_dow + ) subq_11 + ) subq_12 + ON + ( + subq_4.metric_time__extract_dow = subq_12.metric_time__extract_dow + ) OR ( + ( + subq_4.metric_time__extract_dow IS NULL + ) AND ( + subq_12.metric_time__extract_dow IS NULL + ) + ) +) subq_13 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..d1a408e031 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_offset_window_with_date_part__plan0_optimized.sql @@ -0,0 +1,63 @@ +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_18.metric_time__extract_dow, subq_26.metric_time__extract_dow) AS metric_time__extract_dow + , subq_18.bookings AS bookings + , subq_26.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_16 + GROUP BY + metric_time__extract_dow + ) subq_18 + INNER JOIN ( + -- Join to Time Spine Dataset + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + EXTRACT(dow FROM subq_22.ds) AS metric_time__extract_dow + , SUM(subq_20.bookings) AS bookings_2_weeks_ago + FROM ***************************.mf_time_spine subq_22 + INNER JOIN ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + SELECT + ds AS metric_time__day + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_20 + ON + DATEADD(day, -14, subq_22.ds) = subq_20.metric_time__day + GROUP BY + EXTRACT(dow FROM subq_22.ds) + ) subq_26 + ON + ( + subq_18.metric_time__extract_dow = subq_26.metric_time__extract_dow + ) OR ( + ( + subq_18.metric_time__extract_dow IS NULL + ) AND ( + subq_26.metric_time__extract_dow IS NULL + ) + ) +) subq_27 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0.sql new file mode 100644 index 0000000000..3869c341c5 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0.sql @@ -0,0 +1,227 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..33b25a725c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_date_part__plan0_optimized.sql @@ -0,0 +1,17 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_dow diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0.sql new file mode 100644 index 0000000000..b1321ec748 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0.sql @@ -0,0 +1,258 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_year + , subq_3.metric_time__extract_quarter + , subq_3.metric_time__extract_month + , subq_3.metric_time__extract_week + , subq_3.metric_time__extract_day + , subq_3.metric_time__extract_dow + , subq_3.metric_time__extract_doy + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0_optimized.sql new file mode 100644 index 0000000000..402fb4f517 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Redshift/test_simple_query_with_multiple_date_parts__plan0_optimized.sql @@ -0,0 +1,42 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql index d1740a6a39..79946c1bc1 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_through_scd_dimension__plan0.sql @@ -381,25 +381,25 @@ FROM ( -- 'ds__month', -- 'ds__quarter', -- 'ds__year', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', - -- 'ds__day', + -- 'ds__extract_year', + -- 'ds__extract_quarter', + -- 'ds__extract_month', + -- 'ds__extract_week', + -- 'ds__extract_day', + -- 'ds__extract_dow', + -- 'ds__extract_doy', -- 'user__ds__day', -- 'user__ds__week', -- 'user__ds__month', -- 'user__ds__quarter', -- 'user__ds__year', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', - -- 'user__ds__day', + -- 'user__ds__extract_year', + -- 'user__ds__extract_quarter', + -- 'user__ds__extract_month', + -- 'user__ds__extract_week', + -- 'user__ds__extract_day', + -- 'user__ds__extract_dow', + -- 'user__ds__extract_doy', -- 'user'] SELECT subq_4.ds__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql index 8abc633b9a..1cfb7780a7 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multi_hop_to_scd_dimension__plan0.sql @@ -288,49 +288,49 @@ FROM ( -- 'window_start__month', -- 'window_start__quarter', -- 'window_start__year', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', - -- 'window_start__day', + -- 'window_start__extract_year', + -- 'window_start__extract_quarter', + -- 'window_start__extract_month', + -- 'window_start__extract_week', + -- 'window_start__extract_day', + -- 'window_start__extract_dow', + -- 'window_start__extract_doy', -- 'window_end__day', -- 'window_end__week', -- 'window_end__month', -- 'window_end__quarter', -- 'window_end__year', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', - -- 'window_end__day', + -- 'window_end__extract_year', + -- 'window_end__extract_quarter', + -- 'window_end__extract_month', + -- 'window_end__extract_week', + -- 'window_end__extract_day', + -- 'window_end__extract_dow', + -- 'window_end__extract_doy', -- 'lux_listing__window_start__day', -- 'lux_listing__window_start__week', -- 'lux_listing__window_start__month', -- 'lux_listing__window_start__quarter', -- 'lux_listing__window_start__year', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', - -- 'lux_listing__window_start__day', + -- 'lux_listing__window_start__extract_year', + -- 'lux_listing__window_start__extract_quarter', + -- 'lux_listing__window_start__extract_month', + -- 'lux_listing__window_start__extract_week', + -- 'lux_listing__window_start__extract_day', + -- 'lux_listing__window_start__extract_dow', + -- 'lux_listing__window_start__extract_doy', -- 'lux_listing__window_end__day', -- 'lux_listing__window_end__week', -- 'lux_listing__window_end__month', -- 'lux_listing__window_end__quarter', -- 'lux_listing__window_end__year', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', - -- 'lux_listing__window_end__day', + -- 'lux_listing__window_end__extract_year', + -- 'lux_listing__window_end__extract_quarter', + -- 'lux_listing__window_end__extract_month', + -- 'lux_listing__window_end__extract_week', + -- 'lux_listing__window_end__extract_day', + -- 'lux_listing__window_end__extract_dow', + -- 'lux_listing__window_end__extract_doy', -- 'lux_listing'] SELECT subq_4.window_start__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql index 99d4dba7cb..0d1825bde4 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_multihop_node__plan0.sql @@ -252,25 +252,25 @@ FROM ( -- 'ds_partitioned__month', -- 'ds_partitioned__quarter', -- 'ds_partitioned__year', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', - -- 'ds_partitioned__day', + -- 'ds_partitioned__extract_year', + -- 'ds_partitioned__extract_quarter', + -- 'ds_partitioned__extract_month', + -- 'ds_partitioned__extract_week', + -- 'ds_partitioned__extract_day', + -- 'ds_partitioned__extract_dow', + -- 'ds_partitioned__extract_doy', -- 'customer_id__ds_partitioned__day', -- 'customer_id__ds_partitioned__week', -- 'customer_id__ds_partitioned__month', -- 'customer_id__ds_partitioned__quarter', -- 'customer_id__ds_partitioned__year', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', - -- 'customer_id__ds_partitioned__day', + -- 'customer_id__ds_partitioned__extract_year', + -- 'customer_id__ds_partitioned__extract_quarter', + -- 'customer_id__ds_partitioned__extract_month', + -- 'customer_id__ds_partitioned__extract_week', + -- 'customer_id__ds_partitioned__extract_day', + -- 'customer_id__ds_partitioned__extract_dow', + -- 'customer_id__ds_partitioned__extract_doy', -- 'customer_id'] SELECT subq_4.ds_partitioned__day diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql new file mode 100644 index 0000000000..68e1d3302c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0.sql @@ -0,0 +1,585 @@ +-- Compute Metrics via Expressions +SELECT + subq_13.metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_4.metric_time__extract_dow, subq_12.metric_time__extract_dow) AS metric_time__extract_dow + , subq_4.bookings AS bookings + , subq_12.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Compute Metrics via Expressions + SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings + FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow + ) subq_3 + ) subq_4 + INNER JOIN ( + -- Compute Metrics via Expressions + SELECT + subq_11.metric_time__extract_dow + , subq_11.bookings AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + SELECT + subq_10.metric_time__extract_dow + , SUM(subq_10.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_9.metric_time__extract_dow + , subq_9.bookings + FROM ( + -- Join to Time Spine Dataset + SELECT + EXTRACT(dow FROM subq_7.metric_time__day) AS metric_time__extract_dow + , subq_6.ds__day AS ds__day + , subq_6.ds__week AS ds__week + , subq_6.ds__month AS ds__month + , subq_6.ds__quarter AS ds__quarter + , subq_6.ds__year AS ds__year + , subq_6.ds__extract_year AS ds__extract_year + , subq_6.ds__extract_quarter AS ds__extract_quarter + , subq_6.ds__extract_month AS ds__extract_month + , subq_6.ds__extract_week AS ds__extract_week + , subq_6.ds__extract_day AS ds__extract_day + , subq_6.ds__extract_dow AS ds__extract_dow + , subq_6.ds__extract_doy AS ds__extract_doy + , subq_6.ds_partitioned__day AS ds_partitioned__day + , subq_6.ds_partitioned__week AS ds_partitioned__week + , subq_6.ds_partitioned__month AS ds_partitioned__month + , subq_6.ds_partitioned__quarter AS ds_partitioned__quarter + , subq_6.ds_partitioned__year AS ds_partitioned__year + , subq_6.ds_partitioned__extract_year AS ds_partitioned__extract_year + , subq_6.ds_partitioned__extract_quarter AS ds_partitioned__extract_quarter + , subq_6.ds_partitioned__extract_month AS ds_partitioned__extract_month + , subq_6.ds_partitioned__extract_week AS ds_partitioned__extract_week + , subq_6.ds_partitioned__extract_day AS ds_partitioned__extract_day + , subq_6.ds_partitioned__extract_dow AS ds_partitioned__extract_dow + , subq_6.ds_partitioned__extract_doy AS ds_partitioned__extract_doy + , subq_6.paid_at__day AS paid_at__day + , subq_6.paid_at__week AS paid_at__week + , subq_6.paid_at__month AS paid_at__month + , subq_6.paid_at__quarter AS paid_at__quarter + , subq_6.paid_at__year AS paid_at__year + , subq_6.paid_at__extract_year AS paid_at__extract_year + , subq_6.paid_at__extract_quarter AS paid_at__extract_quarter + , subq_6.paid_at__extract_month AS paid_at__extract_month + , subq_6.paid_at__extract_week AS paid_at__extract_week + , subq_6.paid_at__extract_day AS paid_at__extract_day + , subq_6.paid_at__extract_dow AS paid_at__extract_dow + , subq_6.paid_at__extract_doy AS paid_at__extract_doy + , subq_6.booking__ds__day AS booking__ds__day + , subq_6.booking__ds__week AS booking__ds__week + , subq_6.booking__ds__month AS booking__ds__month + , subq_6.booking__ds__quarter AS booking__ds__quarter + , subq_6.booking__ds__year AS booking__ds__year + , subq_6.booking__ds__extract_year AS booking__ds__extract_year + , subq_6.booking__ds__extract_quarter AS booking__ds__extract_quarter + , subq_6.booking__ds__extract_month AS booking__ds__extract_month + , subq_6.booking__ds__extract_week AS booking__ds__extract_week + , subq_6.booking__ds__extract_day AS booking__ds__extract_day + , subq_6.booking__ds__extract_dow AS booking__ds__extract_dow + , subq_6.booking__ds__extract_doy AS booking__ds__extract_doy + , subq_6.booking__ds_partitioned__day AS booking__ds_partitioned__day + , subq_6.booking__ds_partitioned__week AS booking__ds_partitioned__week + , subq_6.booking__ds_partitioned__month AS booking__ds_partitioned__month + , subq_6.booking__ds_partitioned__quarter AS booking__ds_partitioned__quarter + , subq_6.booking__ds_partitioned__year AS booking__ds_partitioned__year + , subq_6.booking__ds_partitioned__extract_year AS booking__ds_partitioned__extract_year + , subq_6.booking__ds_partitioned__extract_quarter AS booking__ds_partitioned__extract_quarter + , subq_6.booking__ds_partitioned__extract_month AS booking__ds_partitioned__extract_month + , subq_6.booking__ds_partitioned__extract_week AS booking__ds_partitioned__extract_week + , subq_6.booking__ds_partitioned__extract_day AS booking__ds_partitioned__extract_day + , subq_6.booking__ds_partitioned__extract_dow AS booking__ds_partitioned__extract_dow + , subq_6.booking__ds_partitioned__extract_doy AS booking__ds_partitioned__extract_doy + , subq_6.booking__paid_at__day AS booking__paid_at__day + , subq_6.booking__paid_at__week AS booking__paid_at__week + , subq_6.booking__paid_at__month AS booking__paid_at__month + , subq_6.booking__paid_at__quarter AS booking__paid_at__quarter + , subq_6.booking__paid_at__year AS booking__paid_at__year + , subq_6.booking__paid_at__extract_year AS booking__paid_at__extract_year + , subq_6.booking__paid_at__extract_quarter AS booking__paid_at__extract_quarter + , subq_6.booking__paid_at__extract_month AS booking__paid_at__extract_month + , subq_6.booking__paid_at__extract_week AS booking__paid_at__extract_week + , subq_6.booking__paid_at__extract_day AS booking__paid_at__extract_day + , subq_6.booking__paid_at__extract_dow AS booking__paid_at__extract_dow + , subq_6.booking__paid_at__extract_doy AS booking__paid_at__extract_doy + , subq_6.listing AS listing + , subq_6.guest AS guest + , subq_6.host AS host + , subq_6.booking__listing AS booking__listing + , subq_6.booking__guest AS booking__guest + , subq_6.booking__host AS booking__host + , subq_6.is_instant AS is_instant + , subq_6.booking__is_instant AS booking__is_instant + , subq_6.bookings AS bookings + , subq_6.instant_bookings AS instant_bookings + , subq_6.booking_value AS booking_value + , subq_6.max_booking_value AS max_booking_value + , subq_6.min_booking_value AS min_booking_value + , subq_6.bookers AS bookers + , subq_6.average_booking_value AS average_booking_value + , subq_6.referred_bookings AS referred_bookings + , subq_6.median_booking_value AS median_booking_value + , subq_6.booking_value_p99 AS booking_value_p99 + , subq_6.discrete_booking_value_p99 AS discrete_booking_value_p99 + , subq_6.approximate_continuous_booking_value_p99 AS approximate_continuous_booking_value_p99 + , subq_6.approximate_discrete_booking_value_p99 AS approximate_discrete_booking_value_p99 + FROM ( + -- Date Spine + SELECT + subq_8.ds AS metric_time__day + FROM ***************************.mf_time_spine subq_8 + ) subq_7 + INNER JOIN ( + -- Metric Time Dimension 'ds' + SELECT + subq_5.ds__day + , subq_5.ds__week + , subq_5.ds__month + , subq_5.ds__quarter + , subq_5.ds__year + , subq_5.ds__extract_year + , subq_5.ds__extract_quarter + , subq_5.ds__extract_month + , subq_5.ds__extract_week + , subq_5.ds__extract_day + , subq_5.ds__extract_dow + , subq_5.ds__extract_doy + , subq_5.ds_partitioned__day + , subq_5.ds_partitioned__week + , subq_5.ds_partitioned__month + , subq_5.ds_partitioned__quarter + , subq_5.ds_partitioned__year + , subq_5.ds_partitioned__extract_year + , subq_5.ds_partitioned__extract_quarter + , subq_5.ds_partitioned__extract_month + , subq_5.ds_partitioned__extract_week + , subq_5.ds_partitioned__extract_day + , subq_5.ds_partitioned__extract_dow + , subq_5.ds_partitioned__extract_doy + , subq_5.paid_at__day + , subq_5.paid_at__week + , subq_5.paid_at__month + , subq_5.paid_at__quarter + , subq_5.paid_at__year + , subq_5.paid_at__extract_year + , subq_5.paid_at__extract_quarter + , subq_5.paid_at__extract_month + , subq_5.paid_at__extract_week + , subq_5.paid_at__extract_day + , subq_5.paid_at__extract_dow + , subq_5.paid_at__extract_doy + , subq_5.booking__ds__day + , subq_5.booking__ds__week + , subq_5.booking__ds__month + , subq_5.booking__ds__quarter + , subq_5.booking__ds__year + , subq_5.booking__ds__extract_year + , subq_5.booking__ds__extract_quarter + , subq_5.booking__ds__extract_month + , subq_5.booking__ds__extract_week + , subq_5.booking__ds__extract_day + , subq_5.booking__ds__extract_dow + , subq_5.booking__ds__extract_doy + , subq_5.booking__ds_partitioned__day + , subq_5.booking__ds_partitioned__week + , subq_5.booking__ds_partitioned__month + , subq_5.booking__ds_partitioned__quarter + , subq_5.booking__ds_partitioned__year + , subq_5.booking__ds_partitioned__extract_year + , subq_5.booking__ds_partitioned__extract_quarter + , subq_5.booking__ds_partitioned__extract_month + , subq_5.booking__ds_partitioned__extract_week + , subq_5.booking__ds_partitioned__extract_day + , subq_5.booking__ds_partitioned__extract_dow + , subq_5.booking__ds_partitioned__extract_doy + , subq_5.booking__paid_at__day + , subq_5.booking__paid_at__week + , subq_5.booking__paid_at__month + , subq_5.booking__paid_at__quarter + , subq_5.booking__paid_at__year + , subq_5.booking__paid_at__extract_year + , subq_5.booking__paid_at__extract_quarter + , subq_5.booking__paid_at__extract_month + , subq_5.booking__paid_at__extract_week + , subq_5.booking__paid_at__extract_day + , subq_5.booking__paid_at__extract_dow + , subq_5.booking__paid_at__extract_doy + , subq_5.ds__day AS metric_time__day + , subq_5.ds__week AS metric_time__week + , subq_5.ds__month AS metric_time__month + , subq_5.ds__quarter AS metric_time__quarter + , subq_5.ds__year AS metric_time__year + , subq_5.ds__extract_year AS metric_time__extract_year + , subq_5.ds__extract_quarter AS metric_time__extract_quarter + , subq_5.ds__extract_month AS metric_time__extract_month + , subq_5.ds__extract_week AS metric_time__extract_week + , subq_5.ds__extract_day AS metric_time__extract_day + , subq_5.ds__extract_dow AS metric_time__extract_dow + , subq_5.ds__extract_doy AS metric_time__extract_doy + , subq_5.listing + , subq_5.guest + , subq_5.host + , subq_5.booking__listing + , subq_5.booking__guest + , subq_5.booking__host + , subq_5.is_instant + , subq_5.booking__is_instant + , subq_5.bookings + , subq_5.instant_bookings + , subq_5.booking_value + , subq_5.max_booking_value + , subq_5.min_booking_value + , subq_5.bookers + , subq_5.average_booking_value + , subq_5.referred_bookings + , subq_5.median_booking_value + , subq_5.booking_value_p99 + , subq_5.discrete_booking_value_p99 + , subq_5.approximate_continuous_booking_value_p99 + , subq_5.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_5 + ) subq_6 + ON + DATEADD(day, -14, subq_7.metric_time__day) = subq_6.metric_time__day + ) subq_9 + ) subq_10 + GROUP BY + subq_10.metric_time__extract_dow + ) subq_11 + ) subq_12 + ON + ( + subq_4.metric_time__extract_dow = subq_12.metric_time__extract_dow + ) OR ( + ( + subq_4.metric_time__extract_dow IS NULL + ) AND ( + subq_12.metric_time__extract_dow IS NULL + ) + ) +) subq_13 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..d1a408e031 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_offset_window_with_date_part__plan0_optimized.sql @@ -0,0 +1,63 @@ +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , bookings - bookings_2_weeks_ago AS bookings_growth_2_weeks +FROM ( + -- Combine Metrics + SELECT + COALESCE(subq_18.metric_time__extract_dow, subq_26.metric_time__extract_dow) AS metric_time__extract_dow + , subq_18.bookings AS bookings + , subq_26.bookings_2_weeks_ago AS bookings_2_weeks_ago + FROM ( + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_16 + GROUP BY + metric_time__extract_dow + ) subq_18 + INNER JOIN ( + -- Join to Time Spine Dataset + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + -- Aggregate Measures + -- Compute Metrics via Expressions + SELECT + EXTRACT(dow FROM subq_22.ds) AS metric_time__extract_dow + , SUM(subq_20.bookings) AS bookings_2_weeks_ago + FROM ***************************.mf_time_spine subq_22 + INNER JOIN ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + SELECT + ds AS metric_time__day + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_20 + ON + DATEADD(day, -14, subq_22.ds) = subq_20.metric_time__day + GROUP BY + EXTRACT(dow FROM subq_22.ds) + ) subq_26 + ON + ( + subq_18.metric_time__extract_dow = subq_26.metric_time__extract_dow + ) OR ( + ( + subq_18.metric_time__extract_dow IS NULL + ) AND ( + subq_26.metric_time__extract_dow IS NULL + ) + ) +) subq_27 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0.sql new file mode 100644 index 0000000000..3869c341c5 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0.sql @@ -0,0 +1,227 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_dow + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_dow + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + subq_1.metric_time__extract_dow + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_dow +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0_optimized.sql new file mode 100644 index 0000000000..33b25a725c --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_date_part__plan0_optimized.sql @@ -0,0 +1,17 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_dow + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', 'metric_time__extract_dow'] + SELECT + EXTRACT(dow FROM ds) AS metric_time__extract_dow + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_dow diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0.sql new file mode 100644 index 0000000000..b1321ec748 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0.sql @@ -0,0 +1,258 @@ +-- Compute Metrics via Expressions +SELECT + subq_3.metric_time__extract_year + , subq_3.metric_time__extract_quarter + , subq_3.metric_time__extract_month + , subq_3.metric_time__extract_week + , subq_3.metric_time__extract_day + , subq_3.metric_time__extract_dow + , subq_3.metric_time__extract_doy + , subq_3.bookings +FROM ( + -- Aggregate Measures + SELECT + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy + , SUM(subq_2.bookings) AS bookings + FROM ( + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + subq_1.metric_time__extract_year + , subq_1.metric_time__extract_quarter + , subq_1.metric_time__extract_month + , subq_1.metric_time__extract_week + , subq_1.metric_time__extract_day + , subq_1.metric_time__extract_dow + , subq_1.metric_time__extract_doy + , subq_1.bookings + FROM ( + -- Metric Time Dimension 'ds' + SELECT + subq_0.ds__day + , subq_0.ds__week + , subq_0.ds__month + , subq_0.ds__quarter + , subq_0.ds__year + , subq_0.ds__extract_year + , subq_0.ds__extract_quarter + , subq_0.ds__extract_month + , subq_0.ds__extract_week + , subq_0.ds__extract_day + , subq_0.ds__extract_dow + , subq_0.ds__extract_doy + , subq_0.ds_partitioned__day + , subq_0.ds_partitioned__week + , subq_0.ds_partitioned__month + , subq_0.ds_partitioned__quarter + , subq_0.ds_partitioned__year + , subq_0.ds_partitioned__extract_year + , subq_0.ds_partitioned__extract_quarter + , subq_0.ds_partitioned__extract_month + , subq_0.ds_partitioned__extract_week + , subq_0.ds_partitioned__extract_day + , subq_0.ds_partitioned__extract_dow + , subq_0.ds_partitioned__extract_doy + , subq_0.paid_at__day + , subq_0.paid_at__week + , subq_0.paid_at__month + , subq_0.paid_at__quarter + , subq_0.paid_at__year + , subq_0.paid_at__extract_year + , subq_0.paid_at__extract_quarter + , subq_0.paid_at__extract_month + , subq_0.paid_at__extract_week + , subq_0.paid_at__extract_day + , subq_0.paid_at__extract_dow + , subq_0.paid_at__extract_doy + , subq_0.booking__ds__day + , subq_0.booking__ds__week + , subq_0.booking__ds__month + , subq_0.booking__ds__quarter + , subq_0.booking__ds__year + , subq_0.booking__ds__extract_year + , subq_0.booking__ds__extract_quarter + , subq_0.booking__ds__extract_month + , subq_0.booking__ds__extract_week + , subq_0.booking__ds__extract_day + , subq_0.booking__ds__extract_dow + , subq_0.booking__ds__extract_doy + , subq_0.booking__ds_partitioned__day + , subq_0.booking__ds_partitioned__week + , subq_0.booking__ds_partitioned__month + , subq_0.booking__ds_partitioned__quarter + , subq_0.booking__ds_partitioned__year + , subq_0.booking__ds_partitioned__extract_year + , subq_0.booking__ds_partitioned__extract_quarter + , subq_0.booking__ds_partitioned__extract_month + , subq_0.booking__ds_partitioned__extract_week + , subq_0.booking__ds_partitioned__extract_day + , subq_0.booking__ds_partitioned__extract_dow + , subq_0.booking__ds_partitioned__extract_doy + , subq_0.booking__paid_at__day + , 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.booking__paid_at__extract_year + , subq_0.booking__paid_at__extract_quarter + , subq_0.booking__paid_at__extract_month + , subq_0.booking__paid_at__extract_week + , subq_0.booking__paid_at__extract_day + , subq_0.booking__paid_at__extract_dow + , subq_0.booking__paid_at__extract_doy + , subq_0.ds__day AS metric_time__day + , subq_0.ds__week AS metric_time__week + , subq_0.ds__month AS metric_time__month + , subq_0.ds__quarter AS metric_time__quarter + , subq_0.ds__year AS metric_time__year + , subq_0.ds__extract_year AS metric_time__extract_year + , subq_0.ds__extract_quarter AS metric_time__extract_quarter + , subq_0.ds__extract_month AS metric_time__extract_month + , subq_0.ds__extract_week AS metric_time__extract_week + , subq_0.ds__extract_day AS metric_time__extract_day + , subq_0.ds__extract_dow AS metric_time__extract_dow + , subq_0.ds__extract_doy AS metric_time__extract_doy + , subq_0.listing + , subq_0.guest + , subq_0.host + , subq_0.booking__listing + , subq_0.booking__guest + , subq_0.booking__host + , subq_0.is_instant + , subq_0.booking__is_instant + , 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.referred_bookings + , subq_0.median_booking_value + , subq_0.booking_value_p99 + , subq_0.discrete_booking_value_p99 + , subq_0.approximate_continuous_booking_value_p99 + , subq_0.approximate_discrete_booking_value_p99 + FROM ( + -- Read Elements From Semantic Model 'bookings_source' + SELECT + 1 AS bookings + , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings + , bookings_source_src_10001.booking_value + , bookings_source_src_10001.booking_value AS max_booking_value + , bookings_source_src_10001.booking_value AS min_booking_value + , bookings_source_src_10001.guest_id AS bookers + , bookings_source_src_10001.booking_value AS average_booking_value + , bookings_source_src_10001.booking_value AS booking_payments + , CASE WHEN referrer_id IS NOT NULL THEN 1 ELSE 0 END AS referred_bookings + , bookings_source_src_10001.booking_value AS median_booking_value + , bookings_source_src_10001.booking_value AS booking_value_p99 + , bookings_source_src_10001.booking_value AS discrete_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_continuous_booking_value_p99 + , bookings_source_src_10001.booking_value AS approximate_discrete_booking_value_p99 + , bookings_source_src_10001.is_instant + , bookings_source_src_10001.ds AS ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , bookings_source_src_10001.is_instant AS booking__is_instant + , bookings_source_src_10001.ds AS booking__ds__day + , DATE_TRUNC('week', bookings_source_src_10001.ds) AS booking__ds__week + , DATE_TRUNC('month', bookings_source_src_10001.ds) AS booking__ds__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds) AS booking__ds__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds) AS booking__ds__year + , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day + , DATE_TRUNC('week', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__week + , DATE_TRUNC('month', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__month + , DATE_TRUNC('quarter', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__quarter + , DATE_TRUNC('year', bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__year + , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month + , EXTRACT(week FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , bookings_source_src_10001.paid_at AS booking__paid_at__day + , DATE_TRUNC('week', bookings_source_src_10001.paid_at) AS booking__paid_at__week + , DATE_TRUNC('month', bookings_source_src_10001.paid_at) AS booking__paid_at__month + , DATE_TRUNC('quarter', bookings_source_src_10001.paid_at) AS booking__paid_at__quarter + , DATE_TRUNC('year', bookings_source_src_10001.paid_at) AS booking__paid_at__year + , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year + , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter + , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month + , EXTRACT(week FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day + , EXTRACT(dow FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(doy FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , bookings_source_src_10001.listing_id AS listing + , bookings_source_src_10001.guest_id AS guest + , bookings_source_src_10001.host_id AS host + , bookings_source_src_10001.listing_id AS booking__listing + , bookings_source_src_10001.guest_id AS booking__guest + , bookings_source_src_10001.host_id AS booking__host + FROM ***************************.fct_bookings bookings_source_src_10001 + ) subq_0 + ) subq_1 + ) subq_2 + GROUP BY + subq_2.metric_time__extract_year + , subq_2.metric_time__extract_quarter + , subq_2.metric_time__extract_month + , subq_2.metric_time__extract_week + , subq_2.metric_time__extract_day + , subq_2.metric_time__extract_dow + , subq_2.metric_time__extract_doy +) subq_3 diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0_optimized.sql b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0_optimized.sql new file mode 100644 index 0000000000..402fb4f517 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/Snowflake/test_simple_query_with_multiple_date_parts__plan0_optimized.sql @@ -0,0 +1,42 @@ +-- Aggregate Measures +-- Compute Metrics via Expressions +SELECT + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy + , SUM(bookings) AS bookings +FROM ( + -- Read Elements From Semantic Model 'bookings_source' + -- Metric Time Dimension 'ds' + -- Pass Only Elements: + -- ['bookings', + -- 'metric_time__extract_day', + -- 'metric_time__extract_dow', + -- 'metric_time__extract_doy', + -- 'metric_time__extract_week', + -- 'metric_time__extract_month', + -- 'metric_time__extract_quarter', + -- 'metric_time__extract_year'] + SELECT + EXTRACT(year FROM ds) AS metric_time__extract_year + , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter + , EXTRACT(month FROM ds) AS metric_time__extract_month + , EXTRACT(week FROM ds) AS metric_time__extract_week + , EXTRACT(day FROM ds) AS metric_time__extract_day + , EXTRACT(dow FROM ds) AS metric_time__extract_dow + , EXTRACT(doy FROM ds) AS metric_time__extract_doy + , 1 AS bookings + FROM ***************************.fct_bookings bookings_source_src_10001 +) subq_6 +GROUP BY + metric_time__extract_year + , metric_time__extract_quarter + , metric_time__extract_month + , metric_time__extract_week + , metric_time__extract_day + , metric_time__extract_dow + , metric_time__extract_doy diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml index 63e2148484..ff39aa7c9b 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_through_scd_dimension__plan0.xml @@ -1434,35 +1434,35 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml index a013e8d8c1..ce6f655f22 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multi_hop_to_scd_dimension__plan0.xml @@ -1054,59 +1054,59 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml index 4a1df37c68..188f6f7b0d 100644 --- a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_multihop_node__plan0.xml @@ -906,37 +906,37 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_offset_window_with_date_part__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_offset_window_with_date_part__plan0.xml new file mode 100644 index 0000000000..81d5db4a69 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_offset_window_with_date_part__plan0.xml @@ -0,0 +1,2165 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_date_part__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_date_part__plan0.xml new file mode 100644 index 0000000000..49d52f7aae --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_date_part__plan0.xml @@ -0,0 +1,863 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_multiple_date_parts__plan0.xml b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_multiple_date_parts__plan0.xml new file mode 100644 index 0000000000..f987f53071 --- /dev/null +++ b/metricflow/test/snapshots/test_dataflow_to_sql_plan.py/SqlQueryPlan/test_simple_query_with_multiple_date_parts__plan0.xml @@ -0,0 +1,966 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql index 66b9a92b39..ab0edb4ad2 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0.sql @@ -119,10 +119,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -131,10 +131,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -143,10 +143,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -156,10 +156,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -168,10 +168,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -180,10 +180,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql index cfaecd587b..2b917da7a9 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/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/BigQuery/test_metric_time_dimension_transform_node_using_non_primary_time__plan0_optimized.sql @@ -9,10 +9,10 @@ SELECT , EXTRACT(year FROM ds) AS ds__extract_year , EXTRACT(quarter FROM ds) AS ds__extract_quarter , EXTRACT(month FROM ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(isoweek FROM ds) AS ds__extract_week , EXTRACT(day FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month @@ -21,10 +21,10 @@ SELECT , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month @@ -33,10 +33,10 @@ SELECT , EXTRACT(year FROM paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM paid_at) AS paid_at__extract_week , EXTRACT(day FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month @@ -45,10 +45,10 @@ SELECT , EXTRACT(year FROM ds) AS booking__ds__extract_year , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter , EXTRACT(month FROM ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM ds) AS booking__ds__extract_week , EXTRACT(day FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month @@ -57,10 +57,10 @@ SELECT , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month @@ -69,10 +69,10 @@ SELECT , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS booking__paid_at__extract_doy , paid_at AS metric_time__day , DATE_TRUNC(paid_at, isoweek) AS metric_time__week , DATE_TRUNC(paid_at, month) AS metric_time__month @@ -81,10 +81,10 @@ SELECT , EXTRACT(year FROM paid_at) AS metric_time__extract_year , EXTRACT(quarter FROM paid_at) AS metric_time__extract_quarter , EXTRACT(month FROM paid_at) AS metric_time__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS metric_time__extract_week + , EXTRACT(isoweek FROM paid_at) AS metric_time__extract_week , EXTRACT(day FROM paid_at) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS metric_time__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS metric_time__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS metric_time__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql index 9895b04f88..58b676e2ff 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0.sql @@ -131,10 +131,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -143,10 +143,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -155,10 +155,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -168,10 +168,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -180,10 +180,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -192,10 +192,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql index 9e14d2f83b..6290ee58d6 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_metric_time_dimension_transform_node_using_primary_time__plan0_optimized.sql @@ -9,10 +9,10 @@ SELECT , EXTRACT(year FROM ds) AS ds__extract_year , EXTRACT(quarter FROM ds) AS ds__extract_quarter , EXTRACT(month FROM ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS ds__extract_week + , EXTRACT(isoweek FROM ds) AS ds__extract_week , EXTRACT(day FROM ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS ds__extract_doy , ds_partitioned AS ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS ds_partitioned__month @@ -21,10 +21,10 @@ SELECT , EXTRACT(year FROM ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM ds_partitioned) AS ds_partitioned__extract_doy , paid_at AS paid_at__day , DATE_TRUNC(paid_at, isoweek) AS paid_at__week , DATE_TRUNC(paid_at, month) AS paid_at__month @@ -33,10 +33,10 @@ SELECT , EXTRACT(year FROM paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM paid_at) AS paid_at__extract_week , EXTRACT(day FROM paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS paid_at__extract_doy , ds AS booking__ds__day , DATE_TRUNC(ds, isoweek) AS booking__ds__week , DATE_TRUNC(ds, month) AS booking__ds__month @@ -45,10 +45,10 @@ SELECT , EXTRACT(year FROM ds) AS booking__ds__extract_year , EXTRACT(quarter FROM ds) AS booking__ds__extract_quarter , EXTRACT(month FROM ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM ds) AS booking__ds__extract_week , EXTRACT(day FROM ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM ds) AS booking__ds__extract_doy , ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(ds_partitioned, month) AS booking__ds_partitioned__month @@ -57,10 +57,10 @@ SELECT , EXTRACT(year FROM ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM ds_partitioned) AS booking__ds_partitioned__extract_doy , paid_at AS booking__paid_at__day , DATE_TRUNC(paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(paid_at, month) AS booking__paid_at__month @@ -69,10 +69,10 @@ SELECT , EXTRACT(year FROM paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM paid_at) AS booking__paid_at__extract_doy , ds AS metric_time__day , DATE_TRUNC(ds, isoweek) AS metric_time__week , DATE_TRUNC(ds, month) AS metric_time__month @@ -81,10 +81,10 @@ SELECT , EXTRACT(year FROM ds) AS metric_time__extract_year , EXTRACT(quarter FROM ds) AS metric_time__extract_quarter , EXTRACT(month FROM ds) AS metric_time__extract_month - , EXTRACT(ISOWEEK FROM ds) AS metric_time__extract_week + , EXTRACT(isoweek FROM ds) AS metric_time__extract_week , EXTRACT(day FROM ds) AS metric_time__extract_day - , EXTRACT(DAYOFWEEK FROM ds) AS metric_time__extract_dow - , EXTRACT(DAYOFYEAR FROM ds) AS metric_time__extract_doy + , EXTRACT(dayofweek FROM ds) AS metric_time__extract_dow + , EXTRACT(dayofyear FROM ds) AS metric_time__extract_doy , listing_id AS listing , guest_id AS guest , host_id AS host diff --git a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql index 599746d204..24e3bb6ff9 100644 --- a/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql +++ b/metricflow/test/snapshots/test_metric_time_dimension_to_sql.py/SqlQueryPlan/BigQuery/test_simple_query_with_metric_time_dimension__plan0.sql @@ -153,10 +153,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -165,10 +165,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -177,10 +177,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -190,10 +190,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -202,10 +202,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -214,10 +214,10 @@ FROM ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host @@ -370,10 +370,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS ds__extract_doy , bookings_source_src_10001.ds_partitioned AS ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS ds_partitioned__month @@ -382,10 +382,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS paid_at__month @@ -394,10 +394,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS paid_at__extract_doy , bookings_source_src_10001.is_instant AS booking__is_instant , bookings_source_src_10001.ds AS booking__ds__day , DATE_TRUNC(bookings_source_src_10001.ds, isoweek) AS booking__ds__week @@ -407,10 +407,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds) AS booking__ds__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds) AS booking__ds__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds) AS booking__ds__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds) AS booking__ds__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds) AS booking__ds__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds) AS booking__ds__extract_doy , bookings_source_src_10001.ds_partitioned AS booking__ds_partitioned__day , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, isoweek) AS booking__ds_partitioned__week , DATE_TRUNC(bookings_source_src_10001.ds_partitioned, month) AS booking__ds_partitioned__month @@ -419,10 +419,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_week , EXTRACT(day FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.ds_partitioned) AS booking__ds_partitioned__extract_doy , bookings_source_src_10001.paid_at AS booking__paid_at__day , DATE_TRUNC(bookings_source_src_10001.paid_at, isoweek) AS booking__paid_at__week , DATE_TRUNC(bookings_source_src_10001.paid_at, month) AS booking__paid_at__month @@ -431,10 +431,10 @@ FULL OUTER JOIN ( , EXTRACT(year FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_year , EXTRACT(quarter FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_quarter , EXTRACT(month FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_month - , EXTRACT(ISOWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week + , EXTRACT(isoweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_week , EXTRACT(day FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_day - , EXTRACT(DAYOFWEEK FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow - , EXTRACT(DAYOFYEAR FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy + , EXTRACT(dayofweek FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_dow + , EXTRACT(dayofyear FROM bookings_source_src_10001.paid_at) AS booking__paid_at__extract_doy , bookings_source_src_10001.listing_id AS listing , bookings_source_src_10001.guest_id AS guest , bookings_source_src_10001.host_id AS host diff --git a/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt b/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt index 11a7d2fd95..3abcc19d22 100644 --- a/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt +++ b/metricflow/test/snapshots/test_node_data_set.py/list/test_joined_node_data_set__result0.txt @@ -1,24 +1,24 @@ ['company__ds__day', - 'company__ds__day', - 'company__ds__day', - 'company__ds__day', - 'company__ds__day', - 'company__ds__day', - 'company__ds__day', - 'company__ds__day', + 'company__ds__extract_day', + 'company__ds__extract_dow', + 'company__ds__extract_doy', + 'company__ds__extract_month', + 'company__ds__extract_quarter', + 'company__ds__extract_week', + 'company__ds__extract_year', 'company__ds__month', 'company__ds__quarter', 'company__ds__week', 'company__ds__year', 'company__user', 'ds__day', - 'ds__day', - 'ds__day', - 'ds__day', - 'ds__day', - 'ds__day', - 'ds__day', - 'ds__day', + 'ds__extract_day', + 'ds__extract_dow', + 'ds__extract_doy', + 'ds__extract_month', + 'ds__extract_quarter', + 'ds__extract_week', + 'ds__extract_year', 'ds__month', 'ds__quarter', 'ds__week', @@ -26,13 +26,13 @@ 'txn_revenue', 'user', 'user__ds__day', - 'user__ds__day', - 'user__ds__day', - 'user__ds__day', - 'user__ds__day', - 'user__ds__day', - 'user__ds__day', - 'user__ds__day', + 'user__ds__extract_day', + 'user__ds__extract_dow', + 'user__ds__extract_doy', + 'user__ds__extract_month', + 'user__ds__extract_quarter', + 'user__ds__extract_week', + 'user__ds__extract_year', 'user__ds__month', 'user__ds__quarter', 'user__ds__week', From ce6028c3145875fd767e400333a8282c4290f4c6 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 13 Sep 2023 09:29:44 -0700 Subject: [PATCH 15/15] Cleanup --- metricflow/query/query_parser.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/metricflow/query/query_parser.py b/metricflow/query/query_parser.py index 3cf160a559..ec8389b719 100644 --- a/metricflow/query/query_parser.py +++ b/metricflow/query/query_parser.py @@ -435,15 +435,6 @@ def _parse_and_validate_query( self._time_granularity_solver.validate_time_granularity(metric_references, time_dimension_specs) self._validate_date_part(metric_references, time_dimension_specs) - for time_dimension_spec in time_dimension_specs: - if ( - time_dimension_spec.date_part - and time_dimension_spec.date_part.to_int() < time_dimension_spec.time_granularity.to_int() - ): - raise RequestTimeGranularityException( - f"Date part {time_dimension_spec.date_part.name} is not compatible with time granularity " - f"{time_dimension_spec.time_granularity.name}." - ) order_by_specs = self._parse_order_by(order or [], partial_time_dimension_spec_replacements) @@ -558,7 +549,11 @@ def _validate_date_part( for time_dimension_spec in time_dimension_specs: if time_dimension_spec.date_part: date_part_requested = True - break + if time_dimension_spec.date_part.to_int() < time_dimension_spec.time_granularity.to_int(): + raise RequestTimeGranularityException( + f"Date part {time_dimension_spec.date_part.name} is not compatible with time granularity " + f"{time_dimension_spec.time_granularity.name}." + ) if date_part_requested: for metric_reference in metric_references: metric = self._metric_lookup.get_metric(metric_reference)